Method: Bolt::PuppetDB::Client#query_certnames
- Defined in:
- lib/bolt/puppetdb/client.rb
#query_certnames(query) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/bolt/puppetdb/client.rb', line 18 def query_certnames(query) return [] unless query @logger.debug("Querying certnames") results = make_query(query) if results&.first && !results.first&.key?('certname') fields = results.first&.keys raise Bolt::PuppetDBError, "Query results did not contain a 'certname' field: got #{fields.join(', ')}" end results&.map { |result| result['certname'] }&.uniq end |