mirror of
https://github.com/inspec/inspec
synced 2025-02-17 14:38:43 +00:00
Merge pull request #1870 from chef/dr/sudo-fx
bugfix: sudo-detection for target execution
This commit is contained in:
commit
2dd05857cf
2 changed files with 1 additions and 8 deletions
|
@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
||||||
|
|
||||||
spec.required_ruby_version = '>= 2.1'
|
spec.required_ruby_version = '>= 2.1'
|
||||||
|
|
||||||
spec.add_dependency 'train', '>=0.22.0', '<1.0'
|
spec.add_dependency 'train', '>=0.24.0', '<1.0'
|
||||||
spec.add_dependency 'thor', '~> 0.19'
|
spec.add_dependency 'thor', '~> 0.19'
|
||||||
spec.add_dependency 'json', '>= 1.8', '< 3.0'
|
spec.add_dependency 'json', '>= 1.8', '< 3.0'
|
||||||
spec.add_dependency 'rainbow', '~> 2'
|
spec.add_dependency 'rainbow', '~> 2'
|
||||||
|
|
|
@ -155,13 +155,6 @@ class Inspec::InspecCLI < Inspec::BaseCLI # rubocop:disable Metrics/ClassLength
|
||||||
configure_logger(opts)
|
configure_logger(opts)
|
||||||
o = opts.dup
|
o = opts.dup
|
||||||
|
|
||||||
# print error if user passed --sudo but with no --target
|
|
||||||
if opts[:sudo] && opts[:target].nil?
|
|
||||||
Inspec::Log.error('--sudo is only valid when running against a remote host using --target')
|
|
||||||
Inspec::Log.error('To run InSpec locally with elevated privileges, run `sudo inspec exec ...`')
|
|
||||||
exit 1
|
|
||||||
end
|
|
||||||
|
|
||||||
# run tests
|
# run tests
|
||||||
run_tests(targets, o)
|
run_tests(targets, o)
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
|
|
Loading…
Add table
Reference in a new issue