]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Fix dependency issues introduced with anchor.
authorNan Liu <nan@puppetlabs.com>
Wed, 9 May 2012 18:50:43 +0000 (11:50 -0700)
committerNan Liu <nan@puppetlabs.com>
Wed, 9 May 2012 19:04:17 +0000 (12:04 -0700)
apt::ppa and apt::builddep requires apt class. The anchor introduced for
containment of apt-get update causes a dependency loop. apt::ppa appears
to depend on apt class sources.d direcory. While apt::builddep have no
clear reason for a dependency on apt class. This change refactor both
define type, so they no longer cause a dependency loop.

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

index ce9d8fd6302ac02b4ba75e82539cc3fdfc71d101..997a2064f85e8c372c387c0c50255c4caffd27ba 100644 (file)
@@ -3,8 +3,6 @@
 define apt::builddep() {
   include apt::update
 
-  Class['apt'] -> Apt::Builddep[$name]
-
   exec { "apt-builddep-${name}":
     command => "/usr/bin/apt-get -y --force-yes build-dep ${name}",
     notify  => Exec['apt_update'],
index 578c81df7123c3f0171fddc6d222a410190a9c8d..64c65bbd09e41d595b902135d6fd5222138fb114 100644 (file)
@@ -3,9 +3,6 @@
 define apt::ppa(
   $release = $::lsbdistcodename
 ) {
-
-  Class['apt'] -> Apt::Ppa[$title]
-
   include apt::params
   include apt::update
 
@@ -26,7 +23,8 @@ define apt::ppa(
   exec { "add-apt-repository-${name}":
     command => "/usr/bin/add-apt-repository ${name}",
     creates => "${sources_list_d}/${sources_list_d_filename}",
-    require => Package['python-software-properties'],
+    require => [ File[$sources_list_d],
+                 Package['python-software-properties'] ],
     notify  => Exec['apt_update'],
   }
 
index ab86b93b2e35d0b145f1e601cebd139e7e066a9c..d57c1fb854b98d328a2daa87a3dd96a0a670e6b5 100644 (file)
@@ -29,7 +29,7 @@ describe 'apt::ppa', :type => :define do
       it { should contain_exec("add-apt-repository-#{t}").with(
         'command' => "/usr/bin/add-apt-repository #{t}",
         'creates' => "/etc/apt/sources.list.d/#{filename}",
-        'require' => "Package[python-software-properties]",
+        'require' => ["File[/etc/apt/sources.list.d]", "Package[python-software-properties]"],
         'notify'  => "Exec[apt_update]"
         )
       }