summaryrefslogtreecommitdiff
path: root/lib/chef/client.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-01-16 13:10:53 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-03-05 14:32:05 -0800
commit68ab92f7fea8fd0c13328b79993b354cd60b28bc (patch)
tree089b8fa8a7e35ea37fe69728d9fe1ce567e007fb /lib/chef/client.rb
parentad6abcc84a0bd9bd47b636f7004588510615c188 (diff)
downloadchef-68ab92f7fea8fd0c13328b79993b354cd60b28bc.tar.gz
add ohai[:machinename]
this is an ohai 7 attribute that == the output of /bin/hostname - if the FQDN exists we still prefer that, but requires correct DNS - if the machinename exists then we use that, but requires ohai 7 - then we default to the hostname which should exist on ohai 6, (but sometimes doesn't on some distros?) machinename should always be set on ohai 7, so we should entirely stop seeing CannotDetermineNodeName after it rolls out.
Diffstat (limited to 'lib/chef/client.rb')
-rw-r--r--lib/chef/client.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index aa03f043c2..5ea2d236b2 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -293,7 +293,7 @@ class Chef
end
def node_name
- name = Chef::Config[:node_name] || ohai[:fqdn] || ohai[:hostname]
+ name = Chef::Config[:node_name] || ohai[:fqdn] || ohai[:machinename] || ohai[:hostname]
Chef::Config[:node_name] = name
unless name