]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Sometimes killing apt is too aggressive.
authorMorgan Haskel <morgan@puppetlabs.com>
Mon, 11 Aug 2014 19:56:32 +0000 (15:56 -0400)
committerMorgan Haskel <morgan@puppetlabs.com>
Tue, 12 Aug 2014 16:09:04 +0000 (12:09 -0400)
spec/acceptance/unattended_upgrade_spec.rb

index 09f4e2bed09888036c9c7f6f2b54dbfd9b6c5c85..02ebea4ec9fea95c8dad9fa2456e1d3c1c015881 100644 (file)
@@ -8,10 +8,14 @@ describe 'apt::unattended_upgrades class', :unless => UNSUPPORTED_PLATFORMS.incl
       include apt::unattended_upgrades
       EOS
 
-      # Attempted workaround for problems seen on debian with
-      # something holding the package database open.
-      shell('killall -9 apt-get', { :acceptable_exit_codes => [0,1] })
-      shell('killall -9 dpkg', { :acceptable_exit_codes => [0,1] })
+      if fact('operatingsystem') == 'Debian'
+        # Attempted workaround for problems seen on debian with
+        # something holding the package database open.
+        shell('killall -9 apt-get', { :acceptable_exit_codes => [0,1] })
+        shell('killall -9 dpkg', { :acceptable_exit_codes => [0,1] })
+        shell('dpkg --configure -a')
+      end
+
       apply_manifest(pp, :catch_failures => true)
     end