diff options
author | craigb <craig_bookwalter@ultimatesoftware.com> | 2015-06-08 14:50:47 -0400 |
---|---|---|
committer | craigb <craig_bookwalter@ultimatesoftware.com> | 2015-06-08 14:50:47 -0400 |
commit | 2df4c08b38a00d30a588f28b3400dcf5b482e984 (patch) | |
tree | 097f4cdd6280de70bc8ac9d25a63418dc5fdff96 | |
parent | 06e85b1b94da636ba7bc269eb361fd7c22f6f7af (diff) | |
download | ohai-2df4c08b38a00d30a588f28b3400dcf5b482e984.tar.gz |
On Windows 2008 R2 (and possibly other versions of Windows), node['hostname'] returns only the first 15 characters of the hostname--this breaks for machines with hostnames longer than 15 chars. This commit changes the WMI attribute that populates node['hostname'] to be one that provides the full hostname. The truncated version is preserved in 'machinename'.
-rw-r--r-- | lib/ohai/plugins/hostname.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ohai/plugins/hostname.rb b/lib/ohai/plugins/hostname.rb index 447b255d..c65b7706 100644 --- a/lib/ohai/plugins/hostname.rb +++ b/lib/ohai/plugins/hostname.rb @@ -151,7 +151,7 @@ Ohai.plugin(:Hostname) do wmi = WmiLite::Wmi.new host = wmi.first_of('Win32_ComputerSystem') - hostname "#{host['name']}" + hostname "#{host['dnshostname']}" machinename "#{host['name']}" info = Socket.gethostbyname(Socket.gethostname) |