diff options
author | John Estabrook <jestabro@vyos.io> | 2020-04-10 10:25:25 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2020-04-10 10:25:25 -0500 |
commit | 8e6948f226f4abc749287441c794cf5aeb6da349 (patch) | |
tree | 5de6e47ae8f2064083c13da72644766719d744d1 /src/helpers | |
parent | 162ead0105f3dce3d6ede02d486b3616f84e69f7 (diff) | |
download | vyos-1x-8e6948f226f4abc749287441c794cf5aeb6da349.tar.gz vyos-1x-8e6948f226f4abc749287441c794cf5aeb6da349.zip |
Revert "Revert "util: T2226: rewrite merge config to use cmd""
This reverts commit 6086b7fa718f502563a17569abc81d4ccb94818c.
Diffstat (limited to 'src/helpers')
-rwxr-xr-x | src/helpers/vyos-merge-config.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/helpers/vyos-merge-config.py b/src/helpers/vyos-merge-config.py index 10a5ea4bc..6546c03e3 100755 --- a/src/helpers/vyos-merge-config.py +++ b/src/helpers/vyos-merge-config.py @@ -17,13 +17,13 @@ import sys import os -import subprocess import tempfile import vyos.defaults import vyos.remote from vyos.config import Config from vyos.configtree import ConfigTree from vyos.migrator import Migrator, VirtualMigrator +from vyos.util import cmd if (len(sys.argv) < 2): @@ -100,12 +100,10 @@ if path: add_cmds = [ cmd for cmd in add_cmds if path in cmd ] for cmd in add_cmds: - cmd = "/opt/vyatta/sbin/my_" + cmd - try: - subprocess.check_call(cmd, shell=True) - except subprocess.CalledProcessError as err: - print("Called process error: {}.".format(err)) + cmd(f'/opt/vyatta/sbin/my_{cmd}', message='Called process error') + except OSError as err: + print(err) if effective_config.session_changed(): print("Merge complete. Use 'commit' to make changes effective.") |