lib/bolt/executor.rb in bolt-0.21.8 vs lib/bolt/executor.rb in bolt-0.22.0
- old
+ new
@@ -16,18 +16,22 @@
module Bolt
class Executor
attr_reader :noop, :transports
attr_accessor :run_as
+ # FIXME: There must be a better way
+ # https://makandracards.com/makandra/36011-ruby-do-not-mix-optional-and-keyword-arguments
def initialize(concurrency = 1,
analytics = Bolt::Analytics::NoopClient.new,
noop = nil,
- bundled_content: nil)
+ bundled_content: nil,
+ load_config: true)
@analytics = analytics
@bundled_content = bundled_content
@logger = Logging.logger[self]
@plan_logging = false
+ @load_config = load_config
@transports = Bolt::TRANSPORTS.each_with_object({}) do |(key, val), coll|
coll[key.to_s] = Concurrent::Delay.new do
val.new
end
@@ -210,10 +214,11 @@
def run_task(targets, task, arguments, options = {}, &callback)
description = options.fetch('_description', "task #{task.name}")
log_action(description, targets) do
notify = proc { |event| @notifier.notify(callback, event) if callback }
options = { '_run_as' => run_as }.merge(options) if run_as
+ options = options.merge('_load_config' => @load_config)
arguments['_task'] = task.name
results = batch_execute(targets) do |transport, batch|
with_node_logging("Running task #{task.name} with '#{arguments}' via #{task.input_method}", batch) do
transport.batch_task(batch, task, arguments, options, ¬ify)
@@ -223,10 +228,10 @@
@notifier.shutdown
results
end
end
- def file_upload(targets, source, destination, options = {}, &callback)
+ def upload_file(targets, source, destination, options = {}, &callback)
description = options.fetch('_description', "file upload from #{source} to #{destination}")
log_action(description, targets) do
notify = proc { |event| @notifier.notify(callback, event) if callback }
options = { '_run_as' => run_as }.merge(options) if run_as