+def RunShellCommand(command):
+ """ Run a shell command in subprocess.
+ params: command with arguments to run
+ returns: (exit_code, stdout, stderr)
+ """
+ import shlex, subprocess
+ cmd_args = shlex.split(command)
+ output_str = ""
+ exit_code = 0
+ try:
+ output_str = subprocess.check_output(cmd_args, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError, e:
+ exit_code = e.returncode
+ finally:
+ return (exit_code, output_str, '')
+