mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
linting
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
37ffdd27cb
commit
81305d3270
1 changed files with 7 additions and 7 deletions
|
@ -32,7 +32,7 @@ module Inspec::Resources
|
|||
|
||||
@command = cmd
|
||||
|
||||
cli_timeout = Inspec::Config.cached['command_timeout'].to_i
|
||||
cli_timeout = Inspec::Config.cached["command_timeout"].to_i
|
||||
# Can access this via Inspec::InspecCLI.commands["exec"].options[:command_timeout].default,
|
||||
# but that may not be loaded for kitchen-inspec and other pure gem consumers
|
||||
default_cli_timeout = 3600
|
||||
|
@ -56,12 +56,12 @@ module Inspec::Resources
|
|||
def result
|
||||
@result ||= begin
|
||||
inspec.backend.run_command(@command, timeout: @timeout)
|
||||
rescue Train::CommandTimeoutReached
|
||||
# Without a small sleep, the train connection gets broken
|
||||
# We've already timed out, so a small sleep is not likely to be painful here.
|
||||
sleep 0.1
|
||||
raise Inspec::Exceptions::ResourceFailed,
|
||||
"Command `#{@command}` timed out after #{@timeout} seconds"
|
||||
rescue Train::CommandTimeoutReached
|
||||
# Without a small sleep, the train connection gets broken
|
||||
# We've already timed out, so a small sleep is not likely to be painful here.
|
||||
sleep 0.1
|
||||
raise Inspec::Exceptions::ResourceFailed,
|
||||
"Command `#{@command}` timed out after #{@timeout} seconds"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue