Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore documented puppetdb_query BoltSpec mocking #3220

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions bolt-modules/boltlib/lib/puppet/functions/puppetdb_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,21 @@
# The query type could be more specific ASTQuery = Array[Variant[String, ASTQuery]]

def make_query(query)
make_query_with_instance(query, nil)
puppetdb_client.make_query(query)
end

def make_query_with_instance(query, instance)
puppetdb_client.make_query(query, nil, instance)
end

private

def puppetdb_client
puppetdb_client = Puppet.lookup(:bolt_pdb_client)
# Bolt executor not expected when invoked from apply block
executor = Puppet.lookup(:bolt_executor) { nil }
# Send Analytics Report
executor&.report_function_call(self.class.name)

puppetdb_client.make_query(query, nil, instance)
puppetdb_client
end
end
Loading