lib/bolt/executor.rb in bolt-1.15.0 vs lib/bolt/executor.rb in bolt-1.16.0
- old
+ new
@@ -19,21 +19,17 @@
# 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,
- load_config: true)
+ noop = false)
# lazy-load expensive gem code
require 'concurrent'
@analytics = analytics
- @bundled_content = bundled_content
@logger = Logging.logger[self]
- @load_config = load_config
@transports = Bolt::TRANSPORTS.each_with_object({}) do |(key, val), coll|
coll[key.to_s] = if key == :remote
Concurrent::Delay.new do
val.new(self)
@@ -182,11 +178,11 @@
def report_function_call(function)
@analytics&.event('Plan', 'call_function', label: function)
end
def report_bundled_content(mode, name)
- if @bundled_content&.include?(name)
+ if @analytics.bundled_content&.include?(name)
@analytics&.event('Bundled Content', mode, label: name)
end
end
def report_apply(statement_count, resource_counts)
@@ -261,10 +257,9 @@
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}'", batch) do
transport.batch_task(batch, task, arguments, options, ¬ify)