diff options
-rw-r--r-- | lib/ohai/plugins/linux/hostname.rb | 2 | ||||
-rw-r--r-- | spec/ohai/plugins/linux/hostname_spec.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/ohai/plugins/linux/hostname.rb b/lib/ohai/plugins/linux/hostname.rb index 76469fa5..896ad821 100644 --- a/lib/ohai/plugins/linux/hostname.rb +++ b/lib/ohai/plugins/linux/hostname.rb @@ -18,7 +18,7 @@ provides "hostname", "fqdn" -hostname from("hostname") +hostname from("hostname -s") begin fqdn from("hostname --fqdn") rescue diff --git a/spec/ohai/plugins/linux/hostname_spec.rb b/spec/ohai/plugins/linux/hostname_spec.rb index 9cc5b14d..b564510a 100644 --- a/spec/ohai/plugins/linux/hostname_spec.rb +++ b/spec/ohai/plugins/linux/hostname_spec.rb @@ -24,11 +24,11 @@ describe Ohai::System, "Linux hostname plugin" do @ohai = Ohai::System.new @ohai.stub!(:require_plugin).and_return(true) @ohai[:os] = "linux" - @ohai.stub!(:from).with("hostname").and_return("katie") + @ohai.stub!(:from).with("hostname -s").and_return("katie") @ohai.stub!(:from).with("hostname --fqdn").and_return("katie.bethell") end - it_should_check_from("linux::hostname", "hostname", "hostname", "katie") + it_should_check_from("linux::hostname", "hostname", "hostname -s", "katie") it_should_check_from("linux::hostname", "fqdn", "hostname --fqdn", "katie.bethell") |