]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Avoid variable lookup on apt::unattended_upgrades
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 14 Apr 2013 19:17:39 +0000 (16:17 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 14 Apr 2013 19:17:39 +0000 (16:17 -0300)
The current lookup for '::apt::custom_preferences' might lead to a lookup error
like

  (Scope(Class[Apt::Unattended_upgrades])) Could not look up qualified variable
  '::apt::custom_preferences'; class ::apt has not been evaluated at
  /etc/puppet/modules/apt/manifests/unattended_upgrades.pp:17

Since the lookup apparently happens during compilation time, this commits tries
to fix this issue by using a define() function call instead of the lookup.

manifests/unattended_upgrades.pp

index 4df9b8adad5fcf81db8862480d6b899929fe9174..2a6fe9ed7dc1f271fc4aa60fd7ba9b521a44a220 100644 (file)
@@ -14,7 +14,7 @@ class apt::unattended_upgrades {
     require => Package['unattended-upgrades'],
   }
 
-  if $::apt::custom_preferences != false {
+  if defined(File['apt_config']) {
     Apt_conf['50unattended-upgrades'] {
       before => File['apt_config'],
     }