From 08043adb753210c12cbd704ea800898a17751ff6 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Mon, 11 Aug 2014 15:56:32 -0400 Subject: [PATCH] Sometimes killing apt is too aggressive. --- spec/acceptance/unattended_upgrade_spec.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spec/acceptance/unattended_upgrade_spec.rb b/spec/acceptance/unattended_upgrade_spec.rb index 09f4e2b..02ebea4 100644 --- a/spec/acceptance/unattended_upgrade_spec.rb +++ b/spec/acceptance/unattended_upgrade_spec.rb @@ -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 -- 2.45.2