Project

General

Profile

Bug #20927 ยป salt_exclude_nics_as_facts.patch

Justin Zandbergen, 09/14/2017 08:13 AM

View differences:

app/services/foreman_salt/fact_parser.rb
nil
end
def ignored_interfaces
@ignored_interfaces ||= Setting.convert_array_to_regexp(Setting[:ignored_interface_identifiers])
end
def interfaces
interfaces = {}
facts.each do |fact, value|
next unless value && fact.to_s =~ /^ip_interfaces/
(_, interface, number) = fact.split(FactName::SEPARATOR)
if interface.match(ignored_interfaces)
logger.debug { "skipping interface with identifier '#{interface}' since it was matched by 'ignored_interface_identifiers' setting " }
next
end
interface_name = if number == '0' || number.nil?
interface
    (1-1/1)