Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot/command.py
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-14 17:07:47 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-14 17:07:47 (GMT)
commit35cd6c621138516926a04f0359ebf2a596d26fbd (patch)
tree4727a6679af366a4fdf6b0a212d2c27724746f0e /devbot/command.py
parent42baf22d2f5d1480b337c13e035075a5114c3cc6 (diff)
Factor out executing commands
Diffstat (limited to 'devbot/command.py')
-rw-r--r--devbot/command.py11
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)