diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-04-23 10:54:43 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-04-23 10:54:43 -0700 |
commit | 09349d0c02b6a76b11db20e7f4b4608ec3c801d9 (patch) | |
tree | 6f658266eb705300d3ceeba0afe8b0d57de1785f /lib/chef | |
parent | c045931b3f3ca872df8b4479c0a62d6c45ac472f (diff) | |
download | chef-09349d0c02b6a76b11db20e7f4b4608ec3c801d9.tar.gz |
CHEF-5211: fix configure hostname guessing
ohai[:fqdn] depends on DNS and may be nil. change the algorithm to use
the hostnaome of the machine as a fallback using the same algorithm
that Chef::Client uses for guessing the node_name of a host.
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/knife/configure.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb index 2c77bf101d..8bb8930aee 100644 --- a/lib/chef/knife/configure.rb +++ b/lib/chef/knife/configure.rb @@ -156,7 +156,7 @@ EOH o.load_plugins o.require_plugin 'os' o.require_plugin 'hostname' - o[:fqdn] || 'localhost' + o[:fqdn] || o[:machinename] || o[:hostname] || 'localhost' end def config_file |