class Facts::Freebsd::IsVirtual

Constants

FACT_NAME

Public Class Methods

new() click to toggle source
# File lib/facter/facts/freebsd/is_virtual.rb, line 8
def initialize
  @virtual = Facter::Util::Facts::VirtualDetector.new
end

Public Instance Methods

call_the_resolver() click to toggle source
# File lib/facter/facts/freebsd/is_virtual.rb, line 12
def call_the_resolver
  fact_value = @virtual.platform

  Facter::ResolvedFact.new(FACT_NAME, check_if_virtual(fact_value))
end

Private Instance Methods

check_if_virtual(found_vm) click to toggle source
# File lib/facter/facts/freebsd/is_virtual.rb, line 20
def check_if_virtual(found_vm)
  Facter::Util::Facts::PHYSICAL_HYPERVISORS.count(found_vm).zero?
end