bolt-modules/boltlib/lib/puppet/functions/facts.rb in bolt-1.19.0 vs bolt-modules/boltlib/lib/puppet/functions/facts.rb in bolt-1.20.0
- old
+ new
@@ -12,17 +12,11 @@
param 'Target', :target
return_type 'Hash[String, Data]'
end
def facts(target)
- inventory = Puppet.lookup(:bolt_inventory) { nil }
-
- unless inventory
- raise Puppet::ParseErrorWithIssue.from_issue_and_stack(
- Puppet::Pops::Issues::TASK_MISSING_BOLT, action: _('get facts for a target')
- )
- 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('facts')
inventory.facts(target)
end