diff options
-rw-r--r-- | lib/chef/dsl/reboot_pending.rb | 3 | ||||
-rw-r--r-- | spec/unit/dsl/reboot_pending_spec.rb | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/chef/dsl/reboot_pending.rb b/lib/chef/dsl/reboot_pending.rb index 5a6f8ee219..e115d5441d 100644 --- a/lib/chef/dsl/reboot_pending.rb +++ b/lib/chef/dsl/reboot_pending.rb @@ -45,8 +45,7 @@ class Chef # Vista + Server 2008 and newer may have reboots pending from CBS registry_key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending') - elsif platform?("ubuntu") - # This should work for Debian as well if update-notifier-common happens to be installed. We need an API for that. + elsif platform_family?("debian") File.exist?("/var/run/reboot-required") else false diff --git a/spec/unit/dsl/reboot_pending_spec.rb b/spec/unit/dsl/reboot_pending_spec.rb index 3ad1be9e38..90945c3b80 100644 --- a/spec/unit/dsl/reboot_pending_spec.rb +++ b/spec/unit/dsl/reboot_pending_spec.rb @@ -51,9 +51,9 @@ describe Chef::DSL::RebootPending do end end - context "platform is ubuntu" do + context "platform_family is debian" do before do - allow(recipe).to receive(:platform?).with("ubuntu").and_return(true) + allow(recipe).to receive(:platform_family?).with("debian").and_return(true) end it "should return true if /var/run/reboot-required exists" do |