diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-15 09:54:03 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-15 09:54:03 (GMT) |
commit | 934ec1619f77e73662e7ff0b0d7d2c35225c0c59 (patch) | |
tree | 49ff671d68cd59af8d62a71c324019fa6541a801 /devbot/command.py | |
parent | 4f5c4825ee8b7c0eed917271c09afffb045799c1 (diff) |
Add a --test option
Diffstat (limited to 'devbot/command.py')
-rw-r--r-- | devbot/command.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/devbot/command.py b/devbot/command.py index c6ac319..8da8051 100644 --- a/devbot/command.py +++ b/devbot/command.py @@ -1,11 +1,12 @@ import subprocess -def run_command(args): +def run_command(args, test=False): print " ".join(args) - subprocess.check_call(args) + if not test: + subprocess.check_call(args) -def run_with_sudo(args): +def run_with_sudo(args, test=False): args_with_sudo = ["sudo"] args_with_sudo.extend(args) - run_command(args_with_sudo) + run_command(args_with_sudo, test=test) |