diff options
author | Theodore Nordsieck <theo@opscode.com> | 2013-09-10 11:33:25 -0700 |
---|---|---|
committer | Theodore Nordsieck <theo@opscode.com> | 2013-09-11 16:13:25 -0700 |
commit | 7b34d7e41f4efd8dc5554da1c3d5069d56288cf6 (patch) | |
tree | 8d4be4d66e05b59d7dff55b8926f39534d11e419 /lib/ohai/plugins | |
parent | 54d7135f55277637f813dee4985a1ba1a3226be3 (diff) | |
download | ohai-7b34d7e41f4efd8dc5554da1c3d5069d56288cf6.tar.gz |
Converted plugins/linux/hostname to Mixlib::ShellOut.
Diffstat (limited to 'lib/ohai/plugins')
-rw-r--r-- | lib/ohai/plugins/linux/hostname.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ohai/plugins/linux/hostname.rb b/lib/ohai/plugins/linux/hostname.rb index fe77b3bf..c3f2dc21 100644 --- a/lib/ohai/plugins/linux/hostname.rb +++ b/lib/ohai/plugins/linux/hostname.rb @@ -20,9 +20,11 @@ Ohai.plugin do provides "hostname", "fqdn" collect_data do - hostname from("hostname -s") + so = shell_out("hostname -s") + hostname so.stdout.split($/)[0] begin - fqdn from("hostname --fqdn") + so = shell_out("hostname --fqdn") + fqdn so.stdout.split($/)[0] rescue Ohai::Log.debug("hostname -f returned an error, probably no domain is set") end |