2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-16 12:47:50 +00:00

Treat blank setting for gateway same as unset

It was previously trying to use empty string as gateway in some
contexts.
This commit is contained in:
Jarrod Johnson 2018-01-24 10:55:03 -05:00
parent 4ae32c1219
commit e7a70f390e

View File

@ -83,7 +83,7 @@ def get_nic_config(configmanager, node, ip=None, mac=None):
cfgdata['prefix'] = prefixlen
for setting in nodenetattribs:
gw = nodenetattribs[setting].get('value', None)
if gw is None:
if gw is None or not gw:
continue
if ip_on_same_subnet(ip, gw, prefixlen):
cfgdata['ipv4_gateway'] = gw