diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-01-14 11:01:37 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-01-14 11:01:37 (GMT) |
commit | a75122d1f6b3cbdfb6456e4e559d66e6b8d77e25 (patch) | |
tree | ce0328a09fa930c30c289487c6976775334dedfb /devbot | |
parent | 8be37beabcbaef276a45a44ff94c8ea293c3f05a (diff) |
Make system check interactive in all commands
Diffstat (limited to 'devbot')
-rw-r--r-- | devbot/command.py | 8 | ||||
-rw-r--r-- | devbot/plugins/debian.py | 6 | ||||
-rw-r--r-- | devbot/plugins/fedora.py | 6 |
3 files changed, 12 insertions, 8 deletions
diff --git a/devbot/command.py b/devbot/command.py index 0d9c809..b3bd6fc 100644 --- a/devbot/command.py +++ b/devbot/command.py @@ -4,7 +4,7 @@ import time from devbot import config -def run(args, test=False, retry=0): +def run(args, test=False, interactive=False, retry=0): if test: print " ".join(args) return @@ -12,7 +12,7 @@ def run(args, test=False, retry=0): log_file = None subprocess_args = {"args": args} - if config.log_path: + if config.log_path and not interactive: log_file = open(config.log_path, "a") subprocess_args["stdout"] = log_file subprocess_args["stderr"] = subprocess.STDOUT @@ -38,10 +38,10 @@ def run(args, test=False, retry=0): log_file.close() -def run_with_sudo(args, test=False, retry=0): +def run_with_sudo(args, test=False, interactive=False, retry=0): args_with_sudo = ["sudo"] args_with_sudo.extend(args) print " ".join(args_with_sudo) - run(args_with_sudo, test=test, retry=retry) + run(args_with_sudo, test=test, retry=retry, interactive=interactive) diff --git a/devbot/plugins/debian.py b/devbot/plugins/debian.py index a4e4d67..437846d 100644 --- a/devbot/plugins/debian.py +++ b/devbot/plugins/debian.py @@ -23,7 +23,8 @@ class PackageManager(interfaces.PackageManager): args.append("install") args.extend(packages) - command.run_with_sudo(args, test=self._test) + command.run_with_sudo(args, test=self._test, + interactive=self._interactive) def remove_packages(self, packages): args = ["dpkg", "-P"] @@ -41,7 +42,8 @@ class PackageManager(interfaces.PackageManager): args.append("upgrade") - command.run_with_sudo(args, test=self._test) + command.run_with_sudo(args, test=self._test, + interactive=self._interactive) def find_all(self): return [package.name for package in self._cache diff --git a/devbot/plugins/fedora.py b/devbot/plugins/fedora.py index 2e67674..d1a2936 100644 --- a/devbot/plugins/fedora.py +++ b/devbot/plugins/fedora.py @@ -19,7 +19,8 @@ class PackageManager(interfaces.PackageManager): args.append("install") args.extend(packages) - command.run_with_sudo(args, test=self._test) + command.run_with_sudo(args, test=self._test, + interactive=self._interactive) def remove_packages(self, packages): args = ["rpm", "-e"] @@ -35,7 +36,8 @@ class PackageManager(interfaces.PackageManager): args.append("update") - command.run_with_sudo(args, test=self._test) + command.run_with_sudo(args, test=self._test, + interactive=self._interactive) def find_all(self): query_format = "--queryformat=[%{NAME} ]" |