summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/migration-scripts/system/9-to-109
1 files changed, 5 insertions, 4 deletions
diff --git a/src/migration-scripts/system/9-to-10 b/src/migration-scripts/system/9-to-10
index 006c98a75..885ef819f 100755
--- a/src/migration-scripts/system/9-to-10
+++ b/src/migration-scripts/system/9-to-10
@@ -16,15 +16,16 @@ with open(file_name, 'r') as f:
config_file = f.read()
config = ConfigTree(config_file)
+base_level = ['system', 'login', 'user']
-if not config.exists(['system', 'login', 'user']):
+if not config.exists(base_level):
# Nothing to do, which shouldn't happen anyway
# only if you wipe the config and reboot.
sys.exit(0)
else:
- for usr in config.list_nodes(['system', 'login', 'user']):
- if config.return_value(['system', 'login', 'user', usr, 'level']) == 'operator':
- config.set(['system', 'login', 'user', usr, 'level'], value="admin", replace=True)
+ 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)
try:
open(file_name,'w').write(config.to_string())