2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Fix nic config with mismatched gateway family

When a gateway exists on a family the node
does not exist for, handle the gateway better.
This commit is contained in:
Jarrod Johnson 2021-10-12 15:32:30 -04:00
parent b96e9f4f70
commit 4f40d9635a

View File

@ -337,9 +337,10 @@ def get_nic_config(configmanager, node, ip=None, mac=None, ifidx=None,
elif fam == socket.AF_INET6:
nver = '6'
bynodename = ip6bynodename
bynodenamn = socket.inet_pton(fam, bynodename)
if ipn_on_same_subnet(fam, candgwn, bynodenamn, prefix):
cfgdata['ipv{}_gateway'.format(nver)] = socket.inet_ntop(fam, candgwn)
if bynodename:
bynodenamn = socket.inet_pton(fam, bynodename)
if ipn_on_same_subnet(fam, candgwn, bynodenamn, prefix):
cfgdata['ipv{}_gateway'.format(nver)] = socket.inet_ntop(fam, candgwn)
return cfgdata
if ip is not None:
for prefixinfo in get_prefix_len_for_ip(ip):