lib/inspec/cli.rb in inspec-1.25.1 vs lib/inspec/cli.rb in inspec-1.26.0
- old
+ new
@@ -153,16 +153,9 @@
def exec(*targets)
diagnose
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
pretty_handle_exception(e)
end