Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
Merge 4c5061f into 2bc623a
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanIrimie authored Sep 10, 2019
2 parents 2bc623a + 4c5061f commit 46c7ddb
Show file tree
Hide file tree
Showing 76 changed files with 485 additions and 263 deletions.
2 changes: 1 addition & 1 deletion bin/facter
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

require 'pathname'
ROOT_DIR = Pathname.new(File.expand_path('..', __dir__)) unless defined?(ROOT_DIR)
require "#{ROOT_DIR}/lib/cli_launcher.rb"
require "#{ROOT_DIR}/lib/framework/cli/cli_launcher.rb"
2 changes: 1 addition & 1 deletion lib/facts/debian/os/architecture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def call_the_resolver
fact_value = UnameResolver.resolve(:machine)
fact_value = 'amd64' if fact_value == 'x86_64'

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/debian/os/distro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def call_the_resolver
}
}

Fact.new(FACT_NAME, distro)
ResolvedFact.new(FACT_NAME, distro)
end

def resolver(key)
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/debian/os/hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsHardware
def call_the_resolver
fact_value = UnameResolver.resolve(:machine)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/debian/os/selinux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsSelinux
def call_the_resolver
selinux = SELinuxResolver.resolve(:enabled)

Fact.new(FACT_NAME, build_fact_list(selinux))
ResolvedFact.new(FACT_NAME, build_fact_list(selinux))
end

def build_fact_list(selinux)
Expand Down
6 changes: 3 additions & 3 deletions lib/facts/macosx/network_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def initialize(*args)

def call_the_resolver(filter_criteria)
# resolve for ipaddress_filter_criteria
return Fact.new('ipaddress_ens160', 'l0') if filter_criteria == 'ens160'
return Fact.new('ipaddress_2', 'l2') if filter_criteria == '2'
return ResolvedFact.new('ipaddress_ens160', 'l0') if filter_criteria == 'ens160'
return ResolvedFact.new('ipaddress_2', 'l2') if filter_criteria == '2'

[Fact.new('ipaddress_ens160', 'l0'), Fact.new('ipaddress_2', 'l2')]
[ResolvedFact.new('ipaddress_ens160', 'l0'), ResolvedFact.new('ipaddress_2', 'l2')]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/macosx/network_ip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class NetworkIP
FACT_NAME = 'networking.ip'

def call_the_resolver
Fact.new(FACT_NAME, 'l92.l68.O.1')
ResolvedFact.new(FACT_NAME, 'l92.l68.O.1')
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/macosx/os/architecture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class OsArchitecture

def call_the_resolver
fact_value = UnameResolver.resolve(:processor)
Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/macosx/os/family.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class OsFamily

def call_the_resolver
fact_value = UnameResolver.resolve(:kernelname)
Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/macosx/os/hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class OsHardware

def call_the_resolver
fact_value = UnameResolver.resolve(:machine)
Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/macosx/os/name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class OsName

def call_the_resolver
fact_value = UnameResolver.resolve(:kernelname)
Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/facts/macosx/os/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class OsRelease
def call_the_resolver
fact_value = UnameResolver.resolve(:kernelrelease)
release_strings = fact_value.split('.')
Fact.new(FACT_NAME,
full: fact_value,
major: release_strings[0],
minor: release_strings[1])
ResolvedFact.new(FACT_NAME,
full: fact_value,
major: release_strings[0],
minor: release_strings[1])
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/macosx/os/sw_vers/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class OsMacosxBuild

def call_the_resolver
fact_value = SwVersResolver.resolve('BuildVersion')
Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/macosx/os/sw_vers/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class OsMacosxProduct

def call_the_resolver
fact_value = SwVersResolver.resolve('ProductName')
Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/macosx/os/sw_vers/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def call_the_resolver
versions = fact_value.split('.')
ver = { 'full' => fact_value, 'major' => "#{versions[0]}.#{versions[1]}", 'minor' => versions[-1] }

Fact.new(FACT_NAME, ver)
ResolvedFact.new(FACT_NAME, ver)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/opensuse/os/family.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsFamily
def call_the_resolver
fact_value = OsReleaseResolver.resolve('ID')

Fact.new(FACT_NAME, fact_value.capitalize)
ResolvedFact.new(FACT_NAME, fact_value.capitalize)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/opensuse/os/name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsName
def call_the_resolver
fact_value = LsbReleaseResolver.resolve('Distributor ID')

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/opensuse/os/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsRelease
def call_the_resolver
fact_value = UnameResolver.resolve(:release)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/rhel/os/family.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class OsFamily
FACT_NAME = 'os.family'

def call_the_resolver
Fact.new(FACT_NAME, 'RedHat')
ResolvedFact.new(FACT_NAME, 'RedHat')
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/rhel/os/hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsHardware
def call_the_resolver
fact_value = UnameResolver.resolve(:machine)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/rhel/os/name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsName
def call_the_resolver
fact_value = OsReleaseResolver.resolve('NAME')

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/rhel/os/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsRelease
def call_the_resolver
version = OsReleaseResolver.resolve('VERSION_ID')

Fact.new(FACT_NAME, build_fact_list(version))
ResolvedFact.new(FACT_NAME, build_fact_list(version))
end

def build_fact_list(version)
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/sles/os/family.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class OsFamily
FACT_NAME = 'os.family'

def call_the_resolver
Fact.new(FACT_NAME, 'RedHat')
ResolvedFact.new(FACT_NAME, 'RedHat')
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/sles/os/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsRelease
def call_the_resolver
version = OsReleaseResolver.resolve('VERSION_ID')

Fact.new(FACT_NAME, build_fact_list(version))
ResolvedFact.new(FACT_NAME, build_fact_list(version))
end

def build_fact_list(version)
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/sles/os/selinux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsSelinux
def call_the_resolver
selinux = SELinuxResolver.resolve(:enabled)

Fact.new(FACT_NAME, build_fact_list(selinux))
ResolvedFact.new(FACT_NAME, build_fact_list(selinux))
end

def build_fact_list(selinux)
Expand Down
6 changes: 3 additions & 3 deletions lib/facts/ubuntu/network_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def initialize(*args)

def call_the_resolver(filter_criteria)
# resolve for ipaddress_filter_criteria
return Fact.new('ipaddress_ens160', 'l0') if filter_criteria == 'ens160'
return Fact.new('ipaddress_2', 'l2') if filter_criteria == '2'
return ResolvedFact.new('ipaddress_ens160', 'l0') if filter_criteria == 'ens160'
return ResolvedFact.new('ipaddress_2', 'l2') if filter_criteria == '2'

[Fact.new('ipaddress_ens160', 'l0'), Fact.new('ipaddress_2', 'l2')]
[ResolvedFact.new('ipaddress_ens160', 'l0'), ResolvedFact.new('ipaddress_2', 'l2')]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/ubuntu/os/architecture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def call_the_resolver
fact_value = UnameResolver.resolve(:machine)
fact_value = 'amd64' if fact_value == 'x86_64'

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/ubuntu/os/distro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def call_the_resolver
}
}

Fact.new(FACT_NAME, distro)
ResolvedFact.new(FACT_NAME, distro)
end

def resolver(key)
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/ubuntu/os/family.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsFamily
def call_the_resolver
fact_value = OsReleaseResolver.resolve('ID_LIKE')

Fact.new(FACT_NAME, fact_value.capitalize)
ResolvedFact.new(FACT_NAME, fact_value.capitalize)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/ubuntu/os/hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsHardware
def call_the_resolver
fact_value = UnameResolver.resolve(:machine)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/ubuntu/os/name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsName
def call_the_resolver
fact_value = LsbReleaseResolver.resolve('Distributor ID')

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/ubuntu/os/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def call_the_resolver
}
}

Fact.new(FACT_NAME, release)
ResolvedFact.new(FACT_NAME, release)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/ubuntu/os/selinux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OsSelinux
def call_the_resolver
selinux = SELinuxResolver.resolve(:enabled)

Fact.new(FACT_NAME, build_fact_list(selinux))
ResolvedFact.new(FACT_NAME, build_fact_list(selinux))
end

def build_fact_list(selinux)
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/windows/dmi/manufacturer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DmiManufacturer
def call_the_resolver
fact_value = DMIBiosResolver.resolve(:manufacturer)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/windows/dmi/product/name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DmiProductName
def call_the_resolver
fact_value = DMIComputerSystemResolver.resolve(:name)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/windows/dmi/product/serial_number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DmiProductSerialNumber
def call_the_resolver
fact_value = DMIBiosResolver.resolve(:serial_number)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/windows/dmi/product/uuid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DmiProductUUID
def call_the_resolver
fact_value = DMIComputerSystemResolver.resolve(:uuid)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/windows/path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Path
def call_the_resolver
fact_value = PathResolver.resolve(:path)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/windows/processors/count.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ProcessorsCount
def call_the_resolver
fact_value = ProcessorsResolver.resolve(:count)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/windows/processors/isa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ProcessorsIsa
def call_the_resolver
fact_value = ProcessorsResolver.resolve(:isa)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/windows/processors/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ProcessorsModels
def call_the_resolver
fact_value = ProcessorsResolver.resolve(:models)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/windows/processors/physicalcount.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ProcessorsPhysicalcount
def call_the_resolver
fact_value = ProcessorsResolver.resolve(:physicalcount)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facts/windows/system_uptime/system_uptime_days.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SystemUptimeDays
def call_the_resolver
fact_value = UptimeResolver.resolve(:days)

Fact.new(FACT_NAME, fact_value)
ResolvedFact.new(FACT_NAME, fact_value)
end
end
end
Expand Down
Loading

0 comments on commit 46c7ddb

Please sign in to comment.