From 5a62307d1e080fc28397964f689aea786ae41f7a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 27 Sep 2022 17:05:13 -0400 Subject: [PATCH] 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. --- confluent_server/confluent/netutil.py | 1 + 1 file changed, 1 insertion(+) diff --git a/confluent_server/confluent/netutil.py b/confluent_server/confluent/netutil.py index 4172eab0..b927ea75 100644 --- a/confluent_server/confluent/netutil.py +++ b/confluent_server/confluent/netutil.py @@ -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