]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
(#11966) Update apt::ppa to use apt::update.
authorNan Liu <nan@puppetlabs.com>
Thu, 3 May 2012 17:22:49 +0000 (10:22 -0700)
committerNan Liu <nan@puppetlabs.com>
Fri, 4 May 2012 20:35:25 +0000 (13:35 -0700)
Change apt::ppa define type to also use the apt::update class to invoke
apt-get update once.

manifests/builddep.pp
manifests/ppa.pp
spec/defines/ppa_spec.rb

index 7a9dd332f53d6468b2f740fe3be18acc69c13bbe..35d8d3074b3df09a532f3c50906279e988a2b2bc 100644 (file)
@@ -7,6 +7,6 @@ define apt::builddep() {
 
   exec { "apt-builddep-${name}":
     command => "/usr/bin/apt-get -y --force-yes build-dep ${name}",
-    notify  => Exec["apt update"],
+    notify  => Exec['apt update'],
   }
 }
index d27aca4442ee8253f19333e79f3449a2876d8b04..ca7f620956f0adeacc0a84ed3dd4d986d436845d 100644 (file)
@@ -7,6 +7,7 @@ define apt::ppa(
   Class['apt'] -> Apt::Ppa[$title]
 
   include apt::params
+  include apt::update
 
   $sources_list_d = $apt::params::sources_list_d
 
@@ -14,10 +15,6 @@ define apt::ppa(
     fail('lsbdistcodename fact not available: release parameter required')
   }
 
-  exec { "apt-update-${name}":
-    command     => "${apt::params::provider} update",
-    refreshonly => true,
-  }
 
   $filename_without_slashes = regsubst($name,'/','-','G')
   $filename_without_ppa = regsubst($filename_without_slashes, '^ppa:','','G')
@@ -25,8 +22,8 @@ define apt::ppa(
 
   exec { "add-apt-repository-${name}":
     command => "/usr/bin/add-apt-repository ${name}",
-    notify  => Exec["apt-update-${name}"],
     creates => "${sources_list_d}/${sources_list_d_filename}",
+    notify  => Exec['apt update'],
   }
 
   file { "${sources_list_d}/${sources_list_d_filename}":
index 95830169b73099060b20cf6eea06c6fdfdfe12fa..e3534895aa6a74b41e3784a803aed26e0b512545 100644 (file)
@@ -18,7 +18,7 @@ describe 'apt::ppa', :type => :define do
         t.sub(/^ppa:/,'').gsub('/','-') << "-" << "#{release}.list"
       end
 
-      it { should contain_exec("apt-update-#{t}").with(
+      it { should contain_exec("apt update").with(
         'command'     => '/usr/bin/apt-get update',
         'refreshonly' => true
         )
@@ -26,7 +26,7 @@ describe 'apt::ppa', :type => :define do
 
       it { should contain_exec("add-apt-repository-#{t}").with(
         'command' => "/usr/bin/add-apt-repository #{t}",
-        'notify'  => "Exec[apt-update-#{t}]",
+        'notify'  => "Exec[apt update]",
         'creates' => "/etc/apt/sources.list.d/#{filename}"
         )
       }