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

- old
+ new

@@ -15,16 +15,11 @@ param 'Array[String]', :certnames return_type 'Hash[String, Data]' end def puppetdb_fact(certnames) - puppetdb_client = Puppet.lookup(:bolt_pdb_client) { nil } - unless puppetdb_client - raise Puppet::ParseErrorWithIssue.from_issue_and_stack( - Puppet::Pops::Issues::TASK_MISSING_BOLT, action: _('query facts from puppetdb') - ) - end - + puppetdb_client = Puppet.lookup(:bolt_pdb_client) + # Bolt executor not expected when invoked from apply block executor = Puppet.lookup(:bolt_executor) { nil } executor&.report_function_call('puppetdb_fact') puppetdb_client.facts_for_node(certnames) end