diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-27 17:34:13 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-27 17:34:13 (GMT) |
commit | 8d3d1978996ed0c9bc9e5a7489efb52f33fa2f88 (patch) | |
tree | 0be806e0e6e02666f3f852d60bc2d726f3213405 /devbot/command.py | |
parent | 8a64d0947bb9a3afcc303015ee4bd8835be03a62 (diff) |
Expose log_path from config
Diffstat (limited to 'devbot/command.py')
-rw-r--r-- | devbot/command.py | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/devbot/command.py b/devbot/command.py index 16bc9bd..73c2166 100644 --- a/devbot/command.py +++ b/devbot/command.py @@ -2,22 +2,15 @@ import subprocess import time from devbot import utils - -_log_path = None - - -def set_log_path(path): - global _log_path - _log_path = path - +from devbot import config def run(args, test=False, retry=0): if test: print " ".join(args) return - if _log_path: - stdout = open(_log_path, "a") + if config.log_path: + stdout = open(config.log_path, "a") stderr = subprocess.STDOUT else: stdout = None @@ -30,9 +23,9 @@ def run(args, test=False, retry=0): subprocess.check_call(args, stdout=stdout, stderr=stderr) break except subprocess.CalledProcessError, e: - print "\nCommand failed, tail of %s\n" % _log_path - if _log_path: - subprocess.call(["tail", _log_path]) + print "\nCommand failed, tail of %s\n" % config.log_path + if config.log_path: + subprocess.call(["tail", config.log_path]) if tries < retry + 1: print "Retrying (attempt %d) in 1 minute" % tries |