mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
Apply suggested fix to maintain SSH connection
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
6d7f5a240b
commit
35b0081c2c
1 changed files with 3 additions and 0 deletions
|
@ -49,6 +49,9 @@ module Inspec::Resources
|
|||
@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"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue