summaryrefslogtreecommitdiff
path: root/src/helpers/vyos-merge-config.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2020-04-08 17:01:33 -0500
committerJohn Estabrook <jestabro@vyos.io>2020-04-08 17:01:33 -0500
commit6086b7fa718f502563a17569abc81d4ccb94818c (patch)
treeb0e889d6a2f21c98690257a68a1b36c80f054833 /src/helpers/vyos-merge-config.py
parent10717c6a3cdf7da7025b03c1abdbd813b4970b19 (diff)
downloadvyos-1x-6086b7fa718f502563a17569abc81d4ccb94818c.tar.gz
vyos-1x-6086b7fa718f502563a17569abc81d4ccb94818c.zip
Revert "util: T2226: rewrite merge config to use cmd"
This reverts commit 9664e7d685307f5f9736929731e759ff7bad7353.
Diffstat (limited to 'src/helpers/vyos-merge-config.py')
-rwxr-xr-xsrc/helpers/vyos-merge-config.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/helpers/vyos-merge-config.py b/src/helpers/vyos-merge-config.py
index 6546c03e3..10a5ea4bc 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,10 +100,12 @@ 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:
- cmd(f'/opt/vyatta/sbin/my_{cmd}', message='Called process error')
- except OSError as err:
- print(err)
+ subprocess.check_call(cmd, shell=True)
+ except subprocess.CalledProcessError as err:
+ print("Called process error: {}.".format(err))
if effective_config.session_changed():
print("Merge complete. Use 'commit' to make changes effective.")