Skip to content

Commit 818084b

Browse files
committed
Restore documented puppetdb_query BoltSpec mocking
The documented (and previous to PR #3092 working) puppetdb_client mocking expected only a single value to the function (the query). This change restores that behavior.
1 parent a308978 commit 818084b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,21 @@
3737
# The query type could be more specific ASTQuery = Array[Variant[String, ASTQuery]]
3838

3939
def make_query(query)
40-
make_query_with_instance(query, nil)
40+
puppetdb_client.make_query(query)
4141
end
4242

4343
def make_query_with_instance(query, instance)
44+
puppetdb_client.make_query(query, nil, instance)
45+
end
46+
47+
private
48+
49+
def puppetdb_client
4450
puppetdb_client = Puppet.lookup(:bolt_pdb_client)
4551
# Bolt executor not expected when invoked from apply block
4652
executor = Puppet.lookup(:bolt_executor) { nil }
4753
# Send Analytics Report
4854
executor&.report_function_call(self.class.name)
49-
50-
puppetdb_client.make_query(query, nil, instance)
55+
puppetdb_client
5156
end
5257
end

0 commit comments

Comments
 (0)