diff options
Diffstat (limited to 'src/migration-scripts/openconnect/1-to-2')
-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 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()) |