summaryrefslogtreecommitdiff
path: root/src/helpers/run-config-migration.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2020-03-31 04:53:08 +0700
committerGitHub <noreply@github.com>2020-03-31 04:53:08 +0700
commit41f810998729057a05f240625fffe946d2bf4711 (patch)
treec766470ec065a0edb9eeddd97fc27512dff891de /src/helpers/run-config-migration.py
parent69dda9497229b56bf68e7e66135688561598b892 (diff)
parent1c74d7ec8a239427c8f7e9f6d864c5085372b0e6 (diff)
downloadvyos-1x-41f810998729057a05f240625fffe946d2bf4711.tar.gz
vyos-1x-41f810998729057a05f240625fffe946d2bf4711.zip
Merge pull request #286 from jestabro/change-trailing-syntax
Change trailing syntax
Diffstat (limited to 'src/helpers/run-config-migration.py')
-rwxr-xr-xsrc/helpers/run-config-migration.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/helpers/run-config-migration.py b/src/helpers/run-config-migration.py
index a57a19cdf..3c06e38f8 100755
--- a/src/helpers/run-config-migration.py
+++ b/src/helpers/run-config-migration.py
@@ -69,15 +69,22 @@ def main():
sys.exit(1)
if not virtual:
- migration = Migrator(config_file_name, force=force_on,
- set_vintage=vintage)
+ virtual_migration = VirtualMigrator(config_file_name)
+ virtual_migration.run()
+
+ migration = Migrator(config_file_name, force=force_on)
+ migration.run()
+
+ if not migration.config_changed():
+ os.remove(backup_file_name)
else:
- migration = VirtualMigrator(config_file_name)
+ virtual_migration = VirtualMigrator(config_file_name,
+ set_vintage=vintage)
- migration.run()
+ virtual_migration.run()
- if not migration._changed:
- os.remove(backup_file_name)
+ if not virtual_migration.config_changed():
+ os.remove(backup_file_name)
if __name__ == '__main__':
main()