Host resource ping method should return stdout (#1927)

* Host resource ping method should return stdout

Signed-off-by: Justin Moy <justin.moy@sendgrid.com>

* output connection_output and socket_output

Signed-off-by: Justin Moy <justin.moy@sendgrid.com>

* lint

Signed-off-by: Justin Moy <justin.moy@sendgrid.com>

* remove output from method names / hash keys

Signed-off-by: Justin Moy <justin.moy@sendgrid.com>
This commit is contained in:
Justin Moy 2017-06-15 12:01:16 -06:00 committed by Adam Leff
parent ced4ca1858
commit 45f3b8113c

View file

@ -95,8 +95,12 @@ module Inspec::Resources
ping.fetch(:success, false)
end
def output
ping[:output]
def connection
ping[:connection]
end
def socket
ping[:socket]
end
# returns all A records of the IP address, will return an array
@ -156,7 +160,8 @@ module Inspec::Resources
{
success: resp.exit_status.to_i.zero?,
output: resp.stderr,
connection: resp.stderr,
socket: resp.stdout,
}
end
@ -194,7 +199,8 @@ module Inspec::Resources
{
success: resp.exit_status.to_i.zero?,
output: resp.stderr,
connection: resp.stderr,
socket: resp.stdout,
}
end