From 00eb9e3c9d949db56e82e80820469cb373816c97 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 12 Sep 2023 16:49:15 -0400 Subject: [PATCH] Fix full_net_config with missing address info --- confluent_server/confluent/netutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/netutil.py b/confluent_server/confluent/netutil.py index 66ed2169..37e8d198 100644 --- a/confluent_server/confluent/netutil.py +++ b/confluent_server/confluent/netutil.py @@ -366,7 +366,7 @@ def get_full_net_config(configmanager, node, serverip=None): retattrs['default'] = defaultnic add_netmask(retattrs['default']) ipv4addr = defaultnic.get('ipv4_address', None) - if '/' in ipv4addr: + if ipv4addr and '/' in ipv4addr: ipv4bytes = socket.inet_pton(socket.AF_INET, ipv4addr.split('/')[0]) for addr in nm.myaddrs: if addr[0] != socket.AF_INET: @@ -374,7 +374,7 @@ def get_full_net_config(configmanager, node, serverip=None): if ipn_on_same_subnet(addr[0], addr[1], ipv4bytes, addr[2]): defaultnic['current_nic'] = True ipv6addr = defaultnic.get('ipv6_address', None) - if '/' in ipv6addr: + if ipv6addr and '/' in ipv6addr: ipv6bytes = socket.inet_pton(socket.AF_INET6, ipv6addr.split('/')[0]) for addr in nm.myaddrs: if addr[0] != socket.AF_INET6: