summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-04-05 17:43:25 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-04-06 20:22:35 +0100
commitbd471c2db5c341d6702bc06575a88a6c5579d2de (patch)
treedb2973101b8cd27931d176ad9047af2c36f61a00
parentdce674338bec33a8ba600a85db4e2ce144e3f75b (diff)
downloadvyos-1x-bd471c2db5c341d6702bc06575a88a6c5579d2de.tar.gz
vyos-1x-bd471c2db5c341d6702bc06575a88a6c5579d2de.zip
util: T2226: rewrite config migration to use cmd
-rwxr-xr-xsrc/helpers/run-config-migration.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/helpers/run-config-migration.py b/src/helpers/run-config-migration.py
index 3c06e38f8..cc7166c22 100755
--- a/src/helpers/run-config-migration.py
+++ b/src/helpers/run-config-migration.py
@@ -19,7 +19,8 @@ import os
import sys
import argparse
import datetime
-import subprocess
+
+from vyos.util import cmd
from vyos.migrator import Migrator, VirtualMigrator
def main():
@@ -61,12 +62,7 @@ def main():
'{0:%Y-%m-%d-%H%M%S}'.format(datetime.datetime.now()),
'pre-migration'])
- try:
- subprocess.check_call(['cp', '-p', config_file_name,
- backup_file_name])
- except subprocess.CalledProcessError as err:
- print("Called process error: {}.".format(err))
- sys.exit(1)
+ cmd(f'cp -p {config_file_name} {backup_file_name}')
if not virtual:
virtual_migration = VirtualMigrator(config_file_name)