You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cvm/runhelper/runhelper

20 lines
369 B
Python

#!/usr/bin/python
import json, subprocess
from optparse import OptionParser
parser = OptionParser()
(options, args) = parser.parse_args()
pr = subprocess.Popen(args[0], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
data = pr.communicate()
pr.wait()
obj = {
'stdout': data[0],
'stderr': data[1],
'returncode': pr.returncode
}
print json.dumps(obj)