summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2020-03-30 15:13:48 -0500
committerJohn Estabrook <jestabro@vyos.io>2020-03-30 15:23:59 -0500
commit10b2b9d9bd9e8da76247651c996627a7921a04c3 (patch)
tree7dccf3e518226bbe0464e5d70655a1557e43de56 /src/helpers
parentd41b9e56058c50117e70c7d2639ebbead466da27 (diff)
downloadvyos-1x-10b2b9d9bd9e8da76247651c996627a7921a04c3.tar.gz
vyos-1x-10b2b9d9bd9e8da76247651c996627a7921a04c3.zip
migration: T2029: run virtual migration before migration
Update syntax of component version string, before passing config file to configtree in migration scripts.
Diffstat (limited to 'src/helpers')
-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 6ffd038f3..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, set_vintage=vintage)
+ 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()