diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2014-03-31 14:14:15 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2014-03-31 14:14:15 +0000 |
commit | a630519793291963e33c05bd8d3a675d67c52433 (patch) | |
tree | ae51a7345b7c5a69b796437930defc22169f9d52 | |
parent | 3df9d49e92600a7f395397c57a41c21822f1b443 (diff) | |
download | lorry-controller-a630519793291963e33c05bd8d3a675d67c52433.tar.gz |
Use GitanoCommand in givemejob
-rw-r--r-- | lorrycontroller/givemejob.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lorrycontroller/givemejob.py b/lorrycontroller/givemejob.py index e40de5f..d7bc4ed 100644 --- a/lorrycontroller/givemejob.py +++ b/lorrycontroller/givemejob.py @@ -25,13 +25,6 @@ import cliapp import lorrycontroller -class GitanoCommandFailure(Exception): - - def __init__(self, trovehost, command): - Exception.__init__( - self, 'Failed to run "%s" on Gitano on %s' % (command, trovehost)) - - class GiveMeJob(lorrycontroller.LorryControllerRoute): http_method = 'POST' @@ -110,7 +103,7 @@ class GiveMeJob(lorrycontroller.LorryControllerRoute): self.set_gitano_config( 'localhost', lorry_info['path'], 'project.description', desc) - except GitanoCommandFailure as e: + except lorrycontroller.GitanoCommandFailure as e: logging.error('ERROR: %s' % str(e)) bottle.abort(500) @@ -120,7 +113,7 @@ class GiveMeJob(lorrycontroller.LorryControllerRoute): 'config', cliapp.shell_quote(repo_path), 'show']) if exit: - raise GitanoCommandFailure(trovehost, 'config show') + raise lorrycontroller.GitanoCommandFailure(trovehost, 'config show') # "config REPO show" outputs a sequence of lines of the form "key: value". # Extract those into a collections.defaultdict. @@ -140,7 +133,7 @@ class GiveMeJob(lorrycontroller.LorryControllerRoute): 'set', cliapp.shell_quote(key), cliapp.shell_quote(value)]) if exit: - raise GitanoCommandFailure(trovehost, 'config set') + raise lorrycontroller.GitanoCommandFailure(trovehost, 'config set') def give_job_to_minion(self, statedb, lorry_info, now): path = lorry_info['path'] |