summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-04-05 17:48:04 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-04-06 20:22:35 +0100
commit9664e7d685307f5f9736929731e759ff7bad7353 (patch)
treeb5cc031461153aa624cb3eb6c6af8a9d9564a480 /src/helpers
parent9e0c56cbfa435142f5cb71dffe5eea99470c3a61 (diff)
downloadvyos-1x-9664e7d685307f5f9736929731e759ff7bad7353.tar.gz
vyos-1x-9664e7d685307f5f9736929731e759ff7bad7353.zip
util: T2226: rewrite merge config to use cmd
Diffstat (limited to 'src/helpers')
-rwxr-xr-xsrc/helpers/vyos-merge-config.py10
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.")