def RunCommand(cmd):
"""RunCommand
Runs command specified by user
@param command to execute
"""
logging.debug("Running cmd %s", cmd)
p = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
shell=True)
o, e = p.communicate()
s = p.returncode
if s != 0:
return (s, e)
return (s, o)
# returns error, or None for OK
# opts is dictionary of {option: value}.
# for now we care about size and (maybe) policy
评论列表
文章目录