diff options
author | John Estabrook <jestabro@vyos.io> | 2020-09-25 11:49:30 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2020-09-25 12:49:15 -0500 |
commit | e76d9a009632629e6a22b0d77eebc913c9268a6d (patch) | |
tree | d1fc5743ae884c522e47af083d55f10014c6951f /src/migration-scripts/system/15-to-16 | |
parent | 4c818baa59046bdc5023abe8b63fa6f62611d115 (diff) | |
download | vyos-1x-e76d9a009632629e6a22b0d77eebc913c9268a6d.tar.gz vyos-1x-e76d9a009632629e6a22b0d77eebc913c9268a6d.zip |
syslog: T2899: shift system migration files +1 to allow for crux
Diffstat (limited to 'src/migration-scripts/system/15-to-16')
-rwxr-xr-x | src/migration-scripts/system/15-to-16 | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/src/migration-scripts/system/15-to-16 b/src/migration-scripts/system/15-to-16 index e70893d55..2491e3d0d 100755 --- a/src/migration-scripts/system/15-to-16 +++ b/src/migration-scripts/system/15-to-16 @@ -1,24 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2020 VyOS maintainers and contributors -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 or later as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# * remove "system login user <user> group" node, Why should be add a user to a -# 3rd party group when the system is fully managed by CLI? -# * remove "system login user <user> level" node -# This is the only privilege level left and also the default, what is the -# sense in keeping this orphaned node? +# Make 'system options reboot-on-panic' valueless import os import sys @@ -35,17 +17,17 @@ with open(file_name, 'r') as f: config_file = f.read() config = ConfigTree(config_file) -base = ['system', 'login', 'user'] +base = ['system', 'options'] if not config.exists(base): # Nothing to do sys.exit(0) else: - for user in config.list_nodes(base): - if config.exists(base + [user, 'group']): - config.delete(base + [user, 'group']) - - if config.exists(base + [user, 'level']): - config.delete(base + [user, 'level']) + if config.exists(base + ['reboot-on-panic']): + reboot = config.return_value(base + ['reboot-on-panic']) + config.delete(base + ['reboot-on-panic']) + # create new valueless node if action was true + if reboot == "true": + config.set(base + ['reboot-on-panic']) try: with open(file_name, 'w') as f: |