diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-14 17:07:47 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-14 17:07:47 (GMT) |
commit | 35cd6c621138516926a04f0359ebf2a596d26fbd (patch) | |
tree | 4727a6679af366a4fdf6b0a212d2c27724746f0e /devbot/command.py | |
parent | 42baf22d2f5d1480b337c13e035075a5114c3cc6 (diff) |
Factor out executing commands
Diffstat (limited to 'devbot/command.py')
-rw-r--r-- | devbot/command.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/devbot/command.py b/devbot/command.py new file mode 100644 index 0000000..c6ac319 --- /dev/null +++ b/devbot/command.py @@ -0,0 +1,11 @@ +import subprocess + +def run_command(args): + print " ".join(args) + subprocess.check_call(args) + +def run_with_sudo(args): + args_with_sudo = ["sudo"] + args_with_sudo.extend(args) + + run_command(args_with_sudo) |