lib/bolt/transport/base.rb in bolt-1.13.0 vs lib/bolt/transport/base.rb in bolt-1.13.1
- old
+ new
@@ -93,19 +93,10 @@
def select_interpreter(executable, interpreters)
interpreters[Pathname(executable).extname] if interpreters
end
- def reject_transport_options(target, options)
- if target.options['run-as']
- options.reject { |k, _v| k == '_run_as' }
- else
- options
- end
- end
- private :reject_transport_options
-
# Transform a parameter map to an environment variable map, with parameter names prefixed
# with 'PT_' and values transformed to JSON unless they're strings.
def envify_params(params)
params.each_with_object({}) do |(k, v), h|
v = v.to_json unless v.is_a?(String)
@@ -133,11 +124,11 @@
def batch_task(targets, task, arguments, options = {}, &callback)
assert_batch_size_one("batch_task()", targets)
target = targets.first
with_events(target, callback) do
@logger.debug { "Running task run '#{task}' on #{target.uri}" }
- run_task(target, task, arguments, reject_transport_options(target, options))
+ run_task(target, task, arguments, options)
end
end
# Runs the given command on a batch of nodes.
#
@@ -147,11 +138,11 @@
def batch_command(targets, command, options = {}, &callback)
assert_batch_size_one("batch_command()", targets)
target = targets.first
with_events(target, callback) do
@logger.debug("Running command '#{command}' on #{target.uri}")
- run_command(target, command, reject_transport_options(target, options))
+ run_command(target, command, options)
end
end
# Runs the given script on a batch of nodes.
#
@@ -161,11 +152,11 @@
def batch_script(targets, script, arguments, options = {}, &callback)
assert_batch_size_one("batch_script()", targets)
target = targets.first
with_events(target, callback) do
@logger.debug { "Running script '#{script}' on #{target.uri}" }
- run_script(target, script, arguments, reject_transport_options(target, options))
+ run_script(target, script, arguments, options)
end
end
# Uploads the given source file to the destination location on a batch of nodes.
#
@@ -175,10 +166,10 @@
def batch_upload(targets, source, destination, options = {}, &callback)
assert_batch_size_one("batch_upload()", targets)
target = targets.first
with_events(target, callback) do
@logger.debug { "Uploading: '#{source}' to #{destination} on #{target.uri}" }
- upload(target, source, destination, reject_transport_options(target, options))
+ upload(target, source, destination, options)
end
end
def batch_connected?(targets)
assert_batch_size_one("connected?()", targets)