summaryrefslogtreecommitdiff
path: root/src/migration-scripts/system/9-to-10
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-02-06 08:05:37 +0100
committerChristian Poessinger <christian@poessinger.com>2020-02-06 08:05:37 +0100
commite035548f88388cd12f54a94b4c89bac97ad09ba6 (patch)
tree6de1529e707cef7dc6a9be8779ef9a2806884d26 /src/migration-scripts/system/9-to-10
parent9be9fa95648970a5001566e5dd3960cd77f3b2c3 (diff)
downloadvyos-1x-e035548f88388cd12f54a94b4c89bac97ad09ba6.tar.gz
vyos-1x-e035548f88388cd12f54a94b4c89bac97ad09ba6.zip
migrator: system: add missing if when checking user level in 9-to-10
Diffstat (limited to 'src/migration-scripts/system/9-to-10')
-rwxr-xr-xsrc/migration-scripts/system/9-to-105
1 files changed, 3 insertions, 2 deletions
diff --git a/src/migration-scripts/system/9-to-10 b/src/migration-scripts/system/9-to-10
index 885ef819f..3c49f0d95 100755
--- a/src/migration-scripts/system/9-to-10
+++ b/src/migration-scripts/system/9-to-10
@@ -24,8 +24,9 @@ if not config.exists(base_level):
sys.exit(0)
else:
for user in config.list_nodes(base_level):
- if config.return_value(base_level + [user, 'level']) == 'operator':
- config.set(base_level + [user, 'level'], value="admin", replace=True)
+ if config.exists(base_level + [user, 'level']):
+ if config.return_value(base_level + [user, 'level']) == 'operator':
+ config.set(base_level + [user, 'level'], value="admin", replace=True)
try:
open(file_name,'w').write(config.to_string())