lib/bolt/executor.rb in bolt-3.1.0 vs lib/bolt/executor.rb in bolt-3.3.0

- old
+ new

@@ -2,10 +2,11 @@ # Used for $ERROR_INFO. This *must* be capitalized! require 'English' require 'json' require 'logging' +require 'pathname' require 'set' require 'bolt/analytics' require 'bolt/result' require 'bolt/config' require 'bolt/result_set' @@ -13,20 +14,22 @@ # Load transports require 'bolt/transport/ssh' require 'bolt/transport/winrm' require 'bolt/transport/orch' require 'bolt/transport/local' +require 'bolt/transport/lxd' require 'bolt/transport/docker' require 'bolt/transport/remote' require 'bolt/yarn' module Bolt TRANSPORTS = { ssh: Bolt::Transport::SSH, winrm: Bolt::Transport::WinRM, pcp: Bolt::Transport::Orch, local: Bolt::Transport::Local, + lxd: Bolt::Transport::LXD, docker: Bolt::Transport::Docker, remote: Bolt::Transport::Remote }.freeze class Executor @@ -37,11 +40,10 @@ analytics = Bolt::Analytics::NoopClient.new, noop = false, modified_concurrency = false) # lazy-load expensive gem code require 'concurrent' - @analytics = analytics @logger = Bolt::Logger.logger(self) @transports = Bolt::TRANSPORTS.each_with_object({}) do |(key, val), coll| coll[key.to_s] = if key == :remote @@ -119,12 +121,12 @@ # defined by the transport. Yields each batch, along with the corresponding # transport, to the block in turn and returns an array of result promises. def queue_execute(targets) if @warn_concurrency && targets.length > @concurrency @warn_concurrency = false - msg = "The ulimit is low, which may cause file limit issues. Default concurrency has been set to "\ - "'#{@concurrency}' to mitigate those issues, which may cause Bolt to run slow. "\ + msg = "The ulimit is low, which might cause file limit issues. Default concurrency has been set to "\ + "'#{@concurrency}' to mitigate those issues, which might cause Bolt to run slow. "\ "Disable this warning by configuring ulimit using 'ulimit -n <limit>' in your shell "\ "configuration, or by configuring Bolt's concurrency. "\ "See https://puppet.com/docs/bolt/latest/bolt_known_issues.html for details." Bolt::Logger.warn("low_ulimit", msg) end @@ -227,9 +229,14 @@ @analytics&.event('Plan', 'call_function', label: function) end def report_bundled_content(mode, name) @analytics.report_bundled_content(mode, name) + end + + def report_file_source(plan_function, source) + label = Pathname.new(source).absolute? ? 'absolute' : 'module' + @analytics&.event('Plan', plan_function, label: label) end def report_apply(statement_count, resource_counts) data = { statement_count: statement_count }