summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-02-08 13:18:17 -0800
committerGitHub <noreply@github.com>2021-02-08 13:18:17 -0800
commita2b38ad3ff1a102f6490f035f44125002a32ccfd (patch)
tree6839a8fbd39e4cce178bcf6379095037297ff26a
parentd09026603948e49f34a9429f938429b8e94235f4 (diff)
parent8a491cf06bd89c0ce5b72fe74e47c1dbe47d6ba5 (diff)
downloadchef-a2b38ad3ff1a102f6490f035f44125002a32ccfd.tar.gz
Merge pull request #10989 from chef/reboot_pending
Extend the reboot_pending? helper to all debian-ish platforms
-rw-r--r--lib/chef/dsl/reboot_pending.rb3
-rw-r--r--spec/unit/dsl/reboot_pending_spec.rb4
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