class Facter::Resolvers::Lspci
Constants
- REGEX_VALUES
Private Class Methods
Source
# File lib/facter/resolvers/lspci.rb, line 20 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
Source
# File lib/facter/resolvers/lspci.rb, line 16 def post_resolve(fact_name, _options) @fact_list.fetch(fact_name) { lspci_command(fact_name) } end
Source
# File lib/facter/resolvers/lspci.rb, line 28 def retrieve_vm(output) output.each_line { |line| REGEX_VALUES.each { |key, value| return value if /#{key}/.match?(line) } } nil end