lib/bolt/puppetdb/client.rb
# This method expects an array of certnames to get facts for
This method expects an array of certnames to get facts for
This method expects an array of certnames to get facts for
def facts_for_node(certnames)
        return {} if certnames.empty? || certnames.nil?
        certnames.uniq!
        name_query = certnames.map { |c| ["=", "certname", c] }
        name_query.insert(0, "or")
        @logger.debug("Querying certnames")
        result = make_query(name_query, 'inventory')
        result&.each_with_object({}) do |node, coll|
          coll[node['certname']] = node['facts']
        end
      end
def facts_for_node ( certnames ) return { } if certnames . empty? || certnames . nil? certnames . uniq! name_query = certnames . map { | c | [ "=" , "certname" , c ] } name_query . insert ( 0 , "or" ) @logger . debug ( "Querying certnames" ) result = make_query ( name_query , 'inventory' ) result &. each_with_object ( { } ) do | node , coll | coll [ node [ 'certname' ] ] = node [ 'facts' ] end end
This method expects an array of certnames to get facts for
This method expects an array of certnames to get facts for
certnames
<not_specific>