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

Restore config by name

The change to allow CIDR syntax
broke for configurations that use name for
bmc 'address'.

Fix by letting getaddrinfo have a chance to process the ip before
trying to pton it.
This commit is contained in:
Jarrod Johnson 2022-09-27 17:05:13 -04:00
parent e5360b3b2f
commit 5a62307d1e

View File

@ -560,6 +560,7 @@ def get_nic_config(configmanager, node, ip=None, mac=None, ifidx=None,
if gw is None or not gw:
continue
gwn = socket.inet_pton(fam, gw)
ip = socket.getaddrinfo(ip, 0, proto=socket.IPPROTO_TCP, family=fam)[-1][-1][0]
ipn = socket.inet_pton(fam, ip)
if ipn_on_same_subnet(fam, ipn, gwn, prefix):
cfgdata['ipv{}_gateway'.format(nver)] = gw