From 52bebe41d1fc741423e112378de382a7920b4916 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 13 Sep 2021 10:26:17 -0400 Subject: [PATCH] Provide ipv6 only for deploycfg2 Older profiles may trip over new network lines, spare them 'v6' entries until they opt into deploycfg2. --- confluent_server/confluent/selfservice.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/selfservice.py b/confluent_server/confluent/selfservice.py index 3b0d2294..6e78dc0f 100644 --- a/confluent_server/confluent/selfservice.py +++ b/confluent_server/confluent/selfservice.py @@ -108,7 +108,7 @@ def handle_request(env, start_response): # credential security results in user/password having to be deferred start_response('200 OK', (('Content-Type', retype),)) yield dumper(res) - elif env['PATH_INFO'] == '/self/deploycfg': + elif env['PATH_INFO'] in ('/self/deploycfg', '/self/deploycfg2'): if 'HTTP_CONFLUENT_MGTIFACE' in env: nicname = env['HTTP_CONFLUENT_MGTIFACE'] try: @@ -125,6 +125,10 @@ def handle_request(env, start_response): myip = myip.split(':', 1)[0] myip = myip.replace('[', '').replace(']', '') ncfg = netutil.get_nic_config(cfg, nodename, serverip=myip) + if env['PATH_INFO'] == '/self/deploycfg': + for key in list(ncfg): + if 'v6' in key: + del ncfg[key] if ncfg['prefix']: ncfg['ipv4_netmask'] = netutil.cidr_to_mask(ncfg['prefix']) if ncfg['ipv4_method'] == 'firmwaredhcp':