bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb in bolt-1.30.0 vs bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb in bolt-1.30.1
- old
+ new
@@ -26,11 +26,11 @@
def script_compiler
@script_compiler ||= Puppet::Pal::ScriptCompiler.new(closure_scope.compiler)
end
def inventory
- Puppet.lookup(:bolt_inventory)
+ @inventory ||= Puppet.lookup(:bolt_inventory)
end
def get_task(name, params = {})
tasksig = script_compiler.task_signature(name)
raise Bolt::Error.new("#{name} could not be found", 'bolt/apply-prep') unless tasksig
@@ -59,10 +59,10 @@
inventory.features(target).include?('puppet-agent') ||
executor.transport(target.transport).provided_features.include?('puppet-agent') || target.remote?
end
def executor
- Puppet.lookup(:bolt_executor)
+ @executor ||= Puppet.lookup(:bolt_executor)
end
def apply_prep(target_spec)
unless Puppet[:tasks]
raise Puppet::ParseErrorWithIssue