summaryrefslogtreecommitdiff
path: root/python/vyos/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos/util.py')
-rw-r--r--python/vyos/util.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py
index 87c2dcedc..781fd9a2c 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -55,6 +55,14 @@ def cmd(command, section=''):
# file manipulation
+
+def subprocess_cmd(command):
+ """ execute arbitrary command via Popen """
+ from subprocess import Popen, PIPE
+ p = Popen(command, stdout=PIPE, shell=True)
+ p.communicate()
+
+
def read_file(path):
""" Read a file to string """
with open(path, 'r') as f: