diff options
author | John Estabrook <jestabro@vyos.io> | 2023-06-05 11:53:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-05 11:53:11 -0500 |
commit | 51866e170f93f6b00e4cabcd379f2cdb3728e118 (patch) | |
tree | ac8f86ddf55eb8ab2c9be1e26d64f467e56f83e5 /src/migration-scripts | |
parent | 12b7da289665c75c3839b32c77a491d8909f3e73 (diff) | |
parent | 2ce55816aad83d34a0b9c85db03410e7d0512ed1 (diff) | |
download | vyos-1x-51866e170f93f6b00e4cabcd379f2cdb3728e118.tar.gz vyos-1x-51866e170f93f6b00e4cabcd379f2cdb3728e118.zip |
Merge pull request #2026 from jestabro/openconnect-migration-delete
openconnect: T5259: fix migration logic in delete_value radius|local
Diffstat (limited to 'src/migration-scripts')
-rwxr-xr-x | src/migration-scripts/openconnect/1-to-2 | 14 |
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 7031fb252..51cd6bc37 100755 --- a/src/migration-scripts/openconnect/1-to-2 +++ b/src/migration-scripts/openconnect/1-to-2 @@ -39,13 +39,13 @@ if not config.exists(cfg_base): else: 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']): - # 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) + # if "mode value radius", change to "mode + valueless node radius" + config.delete_value(cfg_base + ['authentication','mode'], 'radius') + config.set(cfg_base + ['authentication', 'mode', 'radius'], value=None) + elif config.return_value(cfg_base + ['authentication', 'mode']) == 'local': + # if "mode local", change to "mode + node local value password" + config.delete_value(cfg_base + ['authentication', 'mode'], 'local') + config.set(cfg_base + ['authentication', 'mode', 'local'], value='password') try: with open(file_name, 'w') as f: f.write(config.to_string()) |