From 9c1e7a7142426bf506fea514ddaa6790e9510c14 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 14 Feb 2023 14:41:50 -0500 Subject: [PATCH] Allow interfaces to supersede default In some scenarios, the 'default' interface is overlapped by another connection, either identical or as a superset in a bond. Whittle down the default interface if superseded to mitigate duplicate interface setup. --- confluent_osdeploy/common/profile/scripts/confignet | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/confluent_osdeploy/common/profile/scripts/confignet b/confluent_osdeploy/common/profile/scripts/confignet index ad877300..b2147e74 100644 --- a/confluent_osdeploy/common/profile/scripts/confignet +++ b/confluent_osdeploy/common/profile/scripts/confignet @@ -344,6 +344,13 @@ if __name__ == '__main__': else: netname_to_interfaces[uname] = {'interfaces': set([iname]), 'settings': nc['extranets'][netname]} doneidxs.add(curridx) + if 'default' in netname_to_interfaces: + for netn in netname_to_interfaces: + if netn == 'default': + continue + netname_to_interfaces['default']['interfaces'] -= netname_to_interfaces[netn]['interfaces'] + if not netname_to_interfaces['default']['interfaces']: + del netname_to_interfaces['default'] rm_tmp_llas(tmpllas) if os.path.exists('/usr/bin/nmcli'): nm = NetworkManager(devtypes)