class Facter::Resolvers::Lspci
Constants
- REGEX_VALUES
Private Class Methods
lspci_command(fact_name)
click to toggle source
# File lib/facter/resolvers/lspci.rb, line 19 def lspci_command(fact_name) output = Facter::Core::Execution.execute('lspci', logger: log) return if output.empty? @fact_list[:vm] = retrieve_vm(output) @fact_list[fact_name] end
post_resolve(fact_name)
click to toggle source
# File lib/facter/resolvers/lspci.rb, line 15 def post_resolve(fact_name) @fact_list.fetch(fact_name) { lspci_command(fact_name) } end
retrieve_vm(output)
click to toggle source
# File lib/facter/resolvers/lspci.rb, line 27 def retrieve_vm(output) output.each_line { |line| REGEX_VALUES.each { |key, value| return value if line =~ /#{key}/ } } nil end