bolt-modules/boltlib/lib/puppet/functions/get_targets.rb in bolt-1.19.0 vs bolt-modules/boltlib/lib/puppet/functions/get_targets.rb in bolt-1.20.0

- old
+ new

@@ -20,17 +20,11 @@ param 'Boltlib::TargetSpec', :names return_type 'Array[Target]' end def get_targets(names) - inventory = Puppet.lookup(:bolt_inventory) { nil } - - unless inventory && Puppet.features.bolt? - raise Puppet::ParseErrorWithIssue.from_issue_and_stack( - Puppet::Pops::Issues::TASK_MISSING_BOLT, action: _('process targets through inventory') - ) - end - + inventory = Puppet.lookup(:bolt_inventory) + # Bolt executor not expected when invoked from apply block executor = Puppet.lookup(:bolt_executor) { nil } executor&.report_function_call('get_targets') inventory.get_targets(names) end