Merge pull request #1870 from chef/dr/sudo-fx

bugfix: sudo-detection for target execution
This commit is contained in:
Christoph Hartmann 2017-05-30 18:24:49 -05:00 committed by GitHub
commit 2dd05857cf
2 changed files with 1 additions and 8 deletions

View file

@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
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 'json', '>= 1.8', '< 3.0'
spec.add_dependency 'rainbow', '~> 2'

View file

@ -155,13 +155,6 @@ class Inspec::InspecCLI < Inspec::BaseCLI # rubocop:disable Metrics/ClassLength
configure_logger(opts)
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(targets, o)
rescue StandardError => e