summaryrefslogtreecommitdiff
path: root/src/migration-scripts/openconnect
diff options
context:
space:
mode:
authorgoodNETnick <33053932+goodNETnick@users.noreply.github.com>2022-04-01 12:09:56 +1000
committergoodNETnick <pknet@ya.ru>2022-04-09 01:33:25 -0400
commit1da9cc02d7c83898c267070618e2cc91e16eb1cf (patch)
treebfe672212ef22b525420428d3f36ff02d6cd5aa0 /src/migration-scripts/openconnect
parentaa5b35b68c1170bfd0b9661bafa72bb10fe6ca95 (diff)
parent53e20097d227ebf4bdb4dc6c85427ec9c5ec3982 (diff)
downloadvyos-1x-1da9cc02d7c83898c267070618e2cc91e16eb1cf.tar.gz
vyos-1x-1da9cc02d7c83898c267070618e2cc91e16eb1cf.zip
ocserv: T4231: Added OTP support for Openconnect 2FA
Diffstat (limited to 'src/migration-scripts/openconnect')
-rwxr-xr-xsrc/migration-scripts/openconnect/1-to-214
1 files changed, 7 insertions, 7 deletions
diff --git a/src/migration-scripts/openconnect/1-to-2 b/src/migration-scripts/openconnect/1-to-2
index 36d807a3c..7031fb252 100755
--- a/src/migration-scripts/openconnect/1-to-2
+++ b/src/migration-scripts/openconnect/1-to-2
@@ -37,15 +37,15 @@ if not config.exists(cfg_base):
# Nothing to do
sys.exit(0)
else:
- if config.exists(cfg_base + ['authentication'] + ['mode']):
- if config.return_value(cfg_base + ['authentication'] + ['mode']) == 'radius':
+ if config.exists(cfg_base + ['authentication', 'mode']):
+ if config.return_value(cfg_base + ['authentication', 'mode']) == 'radius':
# if "mode value radius", change to "tag node mode + valueless node radius"
- config.delete(cfg_base + ['authentication'] + ['mode'] + ['radius'])
- config.set(cfg_base + ['authentication'] + ['mode'] + ['radius'], value=None, replace=True)
- elif not config.exists(cfg_base + ['authentication'] + ['mode'] + ['local']):
+ config.delete(cfg_base + ['authentication','mode', 'radius'])
+ config.set(cfg_base + ['authentication', 'mode', 'radius'], value=None, replace=True)
+ elif not config.exists(cfg_base + ['authentication', 'mode', 'local']):
# if "mode local", change to "tag node mode + node local value password"
- config.delete(cfg_base + ['authentication'] + ['mode'] + ['local'])
- config.set(cfg_base + ['authentication'] + ['mode'] + ['local'], value='password', replace=True)
+ config.delete(cfg_base + ['authentication', 'mode', 'local'])
+ config.set(cfg_base + ['authentication', 'mode', 'local'], value='password', replace=True)
try:
with open(file_name, 'w') as f:
f.write(config.to_string())