mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
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:
parent
ced4ca1858
commit
45f3b8113c
1 changed files with 10 additions and 4 deletions
|
@ -95,8 +95,12 @@ module Inspec::Resources
|
||||||
ping.fetch(:success, false)
|
ping.fetch(:success, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
def output
|
def connection
|
||||||
ping[:output]
|
ping[:connection]
|
||||||
|
end
|
||||||
|
|
||||||
|
def socket
|
||||||
|
ping[:socket]
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns all A records of the IP address, will return an array
|
# 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?,
|
success: resp.exit_status.to_i.zero?,
|
||||||
output: resp.stderr,
|
connection: resp.stderr,
|
||||||
|
socket: resp.stdout,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -194,7 +199,8 @@ module Inspec::Resources
|
||||||
|
|
||||||
{
|
{
|
||||||
success: resp.exit_status.to_i.zero?,
|
success: resp.exit_status.to_i.zero?,
|
||||||
output: resp.stderr,
|
connection: resp.stderr,
|
||||||
|
socket: resp.stdout,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue