diff options
author | Thom May <thom@may.lt> | 2015-08-13 14:56:38 +0100 |
---|---|---|
committer | Thom May <thom@may.lt> | 2015-08-13 14:56:38 +0100 |
commit | d9d63aa96bb0003c4d1e84e79ef86e2778ce21c9 (patch) | |
tree | b687f3f1b90783ab6ea5e14b1680397d6a5294fc | |
parent | f9b99048c1ce00d3c43d5215b166f4b2832160a6 (diff) | |
parent | e8bfae7823d5414eda30fbc63b2d6e4ded96d21f (diff) | |
download | chef-d9d63aa96bb0003c4d1e84e79ef86e2778ce21c9.tar.gz |
Merge pull request #3768 from chef/jhs/fix-reboot_pending
Make reboot_pending? look for CBS RebootPending
-rw-r--r-- | lib/chef/dsl/reboot_pending.rb | 2 | ||||
-rw-r--r-- | spec/unit/dsl/reboot_pending_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/dsl/reboot_pending.rb b/lib/chef/dsl/reboot_pending.rb index 7af67e94a5..c577118dd4 100644 --- a/lib/chef/dsl/reboot_pending.rb +++ b/lib/chef/dsl/reboot_pending.rb @@ -45,7 +45,7 @@ class Chef registry_key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired') || # Vista + Server 2008 and newer may have reboots pending from CBS - registry_key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired') || + registry_key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending') || # The mere existence of the UpdateExeVolatile key should indicate a pending restart for certain updates # http://support.microsoft.com/kb/832475 diff --git a/spec/unit/dsl/reboot_pending_spec.rb b/spec/unit/dsl/reboot_pending_spec.rb index 0f2288740f..a55f91d5e6 100644 --- a/spec/unit/dsl/reboot_pending_spec.rb +++ b/spec/unit/dsl/reboot_pending_spec.rb @@ -46,7 +46,7 @@ describe Chef::DSL::RebootPending do end it 'should return true if key "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired" exists' do - allow(recipe).to receive(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired').and_return(true) + allow(recipe).to receive(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending').and_return(true) expect(recipe.reboot_pending?).to be_truthy end |