]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Remove unnecessary exec
authorGabriel Filion <lelutin@gmail.com>
Mon, 18 Oct 2010 05:43:24 +0000 (01:43 -0400)
committerGabriel Filion <lelutin@gmail.com>
Mon, 18 Oct 2010 05:43:24 +0000 (01:43 -0400)
When $custom_key_dir has not been assigned any value, a useless exec of
/bin/true is run. Remove this by using 'if' instead of 'case'.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
manifests/init.pp

index 9ef1cea70980cafc33037aab3c4718bcc0a84a67..57a685c3f6b7c6b0bc3c7678dbceba9a3f2176f9 100644 (file)
@@ -78,26 +78,21 @@ class apt {
   package { "debian-archive-keyring": ensure => latest }
   # backports uses the normal archive key now
   package { "debian-backports-keyring": ensure => absent }
-        
-  case $custom_key_dir {
-    '': {
-      exec { "/bin/true # no_custom_keydir": }
+
+  if $custom_key_dir {
+    file { "${apt_base_dir}/keys.d":
+      source => "$custom_key_dir",
+      recurse => true,
+      mode => 0755, owner => root, group => root,
     }
-    default: {
-      file { "${apt_base_dir}/keys.d":
-        source => "$custom_key_dir",
-        recurse => true,
-        mode => 0755, owner => root, group => root,
-      }
-      exec { "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\; && apt-get update":
-        alias => "custom_keys",
-        subscribe => File["${apt_base_dir}/keys.d"],
-        refreshonly => true,
-        before => Config_file["apt_config"];
-      }
+    exec { "find ${apt_base_dir}/keys.d -type f -exec apt-key add '{}' \\; && apt-get update":
+      alias => "custom_keys",
+      subscribe => File["${apt_base_dir}/keys.d"],
+      refreshonly => true,
+      before => Config_file["apt_config"];
     }
   }
 
   # workaround for preseeded_package component
   file { [ "/var/cache", "/var/cache/local", "/var/cache/local/preseeding" ]: ensure => directory }
-}     
+}