class Facter::Resolvers::DmiDecode
Constants
- ADDRESS_TO_VERSION
Private Class Methods
Source
# File lib/facter/resolvers/dmi_decode.rb, line 44 def extract_vmware_version(output) address_of_version = output.match(/Address:\s(0x[a-zA-Z0-9]*)/)&.captures&.first ADDRESS_TO_VERSION[address_of_version&.hex] end
Source
# File lib/facter/resolvers/dmi_decode.rb, line 30 def post_resolve(fact_name, _options) @fact_list.fetch(fact_name) { run_dmidecode(fact_name) } end
Source
# File lib/facter/resolvers/dmi_decode.rb, line 34 def run_dmidecode(fact_name) output = Facter::Core::Execution.execute('dmidecode', logger: log) @fact_list[:virtualbox_version] = output.match(/vboxVer_(\S+)/)&.captures&.first @fact_list[:virtualbox_revision] = output.match(/vboxRev_(\S+)/)&.captures&.first @fact_list[:vmware_version] = extract_vmware_version(output) @fact_list[fact_name] end