summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJamie Austin <jamieaustinprogramming@gmail.com>2023-01-28 15:26:53 +1100
committerJamie Austin <jamieaustinprogramming@gmail.com>2023-01-28 15:26:53 +1100
commit9321e75d1edbffe10b6194062c6fad7cbf205e3e (patch)
treec1ee7aa73771aeb4111e986e8878914a5e27e4cf /src
parent9db8c197ab170d18a93d70fca4227e802a7154c1 (diff)
downloadvyos-1x-9321e75d1edbffe10b6194062c6fad7cbf205e3e.tar.gz
vyos-1x-9321e75d1edbffe10b6194062c6fad7cbf205e3e.zip
openconnect: T4955: Removed wrong acctserver in radiusclient.conf
Removes port key from accounting server merged config dictionary.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/vpn_openconnect.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/conf_mode/vpn_openconnect.py b/src/conf_mode/vpn_openconnect.py
index 737e23145..63ffe2a41 100755
--- a/src/conf_mode/vpn_openconnect.py
+++ b/src/conf_mode/vpn_openconnect.py
@@ -82,13 +82,26 @@ def T2665_default_dict_cleanup(origin: dict, default_values: dict) -> dict:
del origin['authentication']['radius']['server']['port']
if not origin["authentication"]['radius']['server']:
raise ConfigError(
- 'Openconnect mode radius required at least one radius server')
+ 'Openconnect authentication mode radius required at least one radius server')
default_values_radius_port = \
default_values['authentication']['radius']['server']['port']
for server, params in origin['authentication']['radius'][
'server'].items():
if 'port' not in params:
params['port'] = default_values_radius_port
+
+ if 'mode' in origin["accounting"] and "radius" in \
+ origin["accounting"]["mode"]:
+ del origin['accounting']['radius']['server']['port']
+ if not origin["accounting"]['radius']['server']:
+ raise ConfigError(
+ 'Openconnect accounting mode radius required at least one radius server')
+ default_values_radius_port = \
+ default_values['accounting']['radius']['server']['port']
+ for server, params in origin['accounting']['radius'][
+ 'server'].items():
+ if 'port' not in params:
+ params['port'] = default_values_radius_port
return origin