From 4e4fe03b6244316973ef1d0463c1c23745a0e616 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 24 Mar 2022 07:44:13 -0400 Subject: [PATCH] Properly honor explicit interface_names A mistake resulted in plural interface_names being treated as singular. --- .../common/profile/scripts/confignet | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/confluent_osdeploy/common/profile/scripts/confignet b/confluent_osdeploy/common/profile/scripts/confignet index 3bdc7638..6ad6e648 100644 --- a/confluent_osdeploy/common/profile/scripts/confignet +++ b/confluent_osdeploy/common/profile/scripts/confignet @@ -325,18 +325,20 @@ if __name__ == '__main__': nc = json.loads(nc) iname = get_interface_name(idxmap[curridx], nc.get('default', {})) if iname: - if 'default' in netname_to_interfaces: - netname_to_interfaces['default']['interfaces'].add(iname) - else: - netname_to_interfaces['default'] = {'interfaces': set([iname]), 'settings': nc['default']} + for iname in iname.split(','): + if 'default' in netname_to_interfaces: + netname_to_interfaces['default']['interfaces'].add(iname) + else: + netname_to_interfaces['default'] = {'interfaces': set([iname]), 'settings': nc['default']} for netname in nc.get('extranets', {}): uname = '_' + netname iname = get_interface_name(idxmap[curridx], nc['extranets'][netname]) if iname: - if uname in netname_to_interfaces: - netname_to_interfaces[uname]['interfaces'].add(iname) - else: - netname_to_interfaces[uname] = {'interfaces': set([iname]), 'settings': nc['extranets'][netname]} + for iname in iname.split(','): + if uname in netname_to_interfaces: + netname_to_interfaces[uname]['interfaces'].add(iname) + else: + netname_to_interfaces[uname] = {'interfaces': set([iname]), 'settings': nc['extranets'][netname]} doneidxs.add(curridx) rm_tmp_llas(tmpllas) if os.path.exists('/usr/bin/nmcli'):