Sha256: 8a48b530b0be567424ca6d36bf9e85163356767cf558e822c90bc368c980998d
Contents?: true
Size: 908 Bytes
Versions: 7
Compression:
Stored size: 908 Bytes
Contents
require 'hammer_cli' require 'foreman_api' require 'hammer_cli_foreman/commands' module HammerCLIForeman class Fact < HammerCLI::AbstractCommand class ListCommand < HammerCLIForeman::ListCommand resource ForemanApi::Resources::FactValue, "index" apipie_options output do from "fact" do field :host, "Host" field :fact, "Fact" field :value, "Value" end end def retrieve_data self.class.unhash_facts(super) end def self.unhash_facts(facts_hash) facts_hash.inject([]) do |list, (host, facts)| list + facts.collect do |(fact, value)| { :fact => { :host => host, :fact => fact, :value => value } } end end end end autoload_subcommands end end HammerCLI::MainCommand.subcommand 'fact', "Search Foreman's facts.", HammerCLIForeman::Fact
Version data entries
7 entries across 7 versions & 1 rubygems