diff --git a/lib/refrepo/input_loader.rb b/lib/refrepo/input_loader.rb index fd88f0401de56402c6313b593536012f8bc7c627..69260c6eddc347c459e71956bf732fb14fa304c2 100644 --- a/lib/refrepo/input_loader.rb +++ b/lib/refrepo/input_loader.rb @@ -114,8 +114,10 @@ def add_ipv6(h) hc['nodes'].each_pair do |node_uid, hn| # get IPv4 ip4 = nil + num_main_interfaces = 0 hn['network_adapters'].each_pair do |iface, nh| - if nh['mountable'] == true and nh['interface'] == 'Ethernet' + if nh['mounted'] == true && nh['interface'] == 'Ethernet' && nh['management'] == false + num_main_interfaces += 1 # for mounted && ethernet interfaces only ip4 = nh['ip'] if not ip4.nil? @@ -132,6 +134,9 @@ def add_ipv6(h) # for all other cases, force no IPv6 nh.delete('ip6') end + if num_main_interfaces > 1 + raise "#{node_uid}.#{site_uid}: more than one interface with mounted == true && interface == 'Ethernet' && management == false" + end end end end