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

Commit

Permalink
(FACT-2541) Add TYPE for legacy facts (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
oanatmaria authored Apr 8, 2020
1 parent e2fdbd6 commit 673dff5
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/facts/el/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module El
class Processor
FACT_NAME = 'processor.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/el/sshalgorithmkey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module El
class Sshalgorithmkey
FACT_NAME = 'ssh.*key'
TYPE = :legacy

def call_the_resolver
facts = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/el/sshfp_algorithm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module El
class SshfpAlgorithm
FACT_NAME = 'sshfp_.*'
TYPE = :legacy

def call_the_resolver
facts = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/macosx/sshalgorithmkey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Macosx
class Sshalgorithmkey
FACT_NAME = 'ssh.*key'
TYPE = :legacy

def call_the_resolver
facts = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/macosx/sshfp_algorithm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Macosx
class SshfpAlgorithm
FACT_NAME = 'sshfp_.*'
TYPE = :legacy

def call_the_resolver
facts = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/sles/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Sles
class Processor
FACT_NAME = 'processor.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/sles/sshalgorithmkey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Sles
class Sshalgorithmkey
FACT_NAME = 'ssh.*key'
TYPE = :legacy

def call_the_resolver
facts = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/sles/sshfp_algorithm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Sles
class SshfpAlgorithm
FACT_NAME = 'sshfp_.*'
TYPE = :legacy

def call_the_resolver
facts = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/windows/ipaddress6_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Windows
class Ipaddress6Interfaces
FACT_NAME = 'ipaddress6_.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/windows/ipaddress_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Windows
class IpaddressInterfaces
FACT_NAME = 'ipaddress_.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/windows/macaddress_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Windows
class MacaddressInterfaces
FACT_NAME = 'macaddress_.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/windows/mtu_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Windows
class MtuInterfaces
FACT_NAME = 'mtu_.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/windows/netmask6_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Windows
class Netmask6Interfaces
FACT_NAME = 'netmask6_.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/windows/netmask_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Windows
class NetmaskInterfaces
FACT_NAME = 'netmask_.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/windows/network6_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Windows
class Network6Interfaces
FACT_NAME = 'network6_.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/windows/network_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Windows
class NetworkInterfaces
FACT_NAME = 'network_.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/windows/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Windows
class Processor
FACT_NAME = 'processor.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
1 change: 1 addition & 0 deletions lib/facts/windows/scope6_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Facts
module Windows
class Scope6Interfaces
FACT_NAME = 'scope6_.*'
TYPE = :legacy

def call_the_resolver
arr = []
Expand Down
2 changes: 1 addition & 1 deletion lib/framework/core/fact_loaders/internal_fact_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def load_for_os(operating_system)
# if fact is already loaded, skip it
next if @facts.any? { |fact| fact.name == fact_name }

type = fact_name.end_with?('.*') ? :legacy : :core
type = class_name.const_defined?('TYPE') ? class_name::TYPE : :core
load_fact(fact_name, class_name, type)
next unless class_name.const_defined?('ALIASES')

Expand Down

0 comments on commit 673dff5

Please sign in to comment.