diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-04 11:29:37 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-04 11:29:37 +0200 |
commit | 25bfece386756cbd40b83bc26141edddb0e05c72 (patch) | |
tree | 129825f3aba898b46352d15b228ebc53b2a43511 /python/vyos | |
parent | 2e1562fb02e7a2b45e84c0b8d861d149bfa890d2 (diff) | |
download | vyos-1x-25bfece386756cbd40b83bc26141edddb0e05c72.tar.gz vyos-1x-25bfece386756cbd40b83bc26141edddb0e05c72.zip |
vyos.util: use common subprocess_cmd wrapper
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/util.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py index 3970b8bf1..5807c837d 100644 --- a/python/vyos/util.py +++ b/python/vyos/util.py @@ -17,6 +17,14 @@ import os import re import sys + +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: |