lib/bolt/transport/sudoable.rb in bolt-1.28.0 vs lib/bolt/transport/sudoable.rb in bolt-1.29.0
- old
+ new
@@ -4,15 +4,10 @@
require 'bolt/transport/base'
module Bolt
module Transport
class Sudoable < Base
- def self.validate_sudo_options(options, logger)
- if options['sudo-password'] && options['run-as'].nil?
- logger.warn("--sudo-password will not be used without specifying a " \
- "user to escalate to with --run-as")
- end
-
+ def self.validate_sudo_options(options)
run_as_cmd = options['run-as-command']
if run_as_cmd && (!run_as_cmd.is_a?(Array) || run_as_cmd.any? { |n| !n.is_a?(String) })
raise Bolt::ValidationError, "run-as-command must be an Array of Strings, received #{run_as_cmd}"
end
end