mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
Make CLI option take precedence over DSL option if it is nondefault
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
35b0081c2c
commit
e5b74b5760
1 changed files with 9 additions and 1 deletions
|
@ -32,7 +32,15 @@ module Inspec::Resources
|
|||
|
||||
@command = cmd
|
||||
|
||||
@timeout = options[:timeout]&.to_i || Inspec::Config.cached.final_options['command_timeout']&.to_i || 3600
|
||||
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
|
||||
if cli_timeout != default_cli_timeout
|
||||
@timeout = cli_timeout
|
||||
else
|
||||
@timeout = options[:timeout]&.to_i || default_cli_timeout
|
||||
end
|
||||
|
||||
if options[:redact_regex]
|
||||
unless options[:redact_regex].is_a?(Regexp)
|
||||
|
|
Loading…
Reference in a new issue