summaryrefslogtreecommitdiff
path: root/lib/chef/resource/hostname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource/hostname.rb')
-rw-r--r--lib/chef/resource/hostname.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index ef0218ebaa..e3897b6bef 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -100,7 +100,7 @@ class Chef
action :set do
description "Sets the node's hostname."
- if node["platform_family"] != "windows"
+ if !windows?
ohai "reload hostname" do
plugin "hostname"
action :nothing
@@ -143,7 +143,7 @@ class Chef
not_if { shell_out!("/usr/sbin/scutil --get LocalHostName").stdout.chomp == shortname }
notifies :reload, "ohai[reload hostname]"
end
- when node["os"] == "linux"
+ when linux?
case
when ::File.exist?("/usr/bin/hostnamectl") && !docker?
# use hostnamectl whenever we find it on linux (as systemd takes over the world)