bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb in bolt-1.33.0 vs bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb in bolt-1.34.0

- old
+ new

@@ -98,11 +98,12 @@ require 'concurrent' pool = Concurrent::ThreadPoolExecutor.new hooks = need_install_targets.map do |t| begin - opts = t.plugin_hooks&.fetch('puppet_library') - hook = inventory.plugins.get_hook(opts['plugin'], :puppet_library) + opts = t.plugin_hooks&.fetch('puppet_library').dup + plugin_name = opts.delete('plugin') + hook = inventory.plugins.get_hook(plugin_name, :puppet_library) { 'target' => t, 'hook_proc' => hook.call(opts, t, self) } rescue StandardError => e Bolt::Result.from_exception(t, e) end