summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lorrycontroller/givemejob.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/lorrycontroller/givemejob.py b/lorrycontroller/givemejob.py
index d7bc4ed..e40de5f 100644
--- a/lorrycontroller/givemejob.py
+++ b/lorrycontroller/givemejob.py
@@ -25,6 +25,13 @@ 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'
@@ -103,7 +110,7 @@ class GiveMeJob(lorrycontroller.LorryControllerRoute):
self.set_gitano_config(
'localhost', lorry_info['path'],
'project.description', desc)
- except lorrycontroller.GitanoCommandFailure as e:
+ except GitanoCommandFailure as e:
logging.error('ERROR: %s' % str(e))
bottle.abort(500)
@@ -113,7 +120,7 @@ class GiveMeJob(lorrycontroller.LorryControllerRoute):
'config', cliapp.shell_quote(repo_path), 'show'])
if exit:
- raise lorrycontroller.GitanoCommandFailure(trovehost, 'config show')
+ raise GitanoCommandFailure(trovehost, 'config show')
# "config REPO show" outputs a sequence of lines of the form "key: value".
# Extract those into a collections.defaultdict.
@@ -133,7 +140,7 @@ class GiveMeJob(lorrycontroller.LorryControllerRoute):
'set', cliapp.shell_quote(key), cliapp.shell_quote(value)])
if exit:
- raise lorrycontroller.GitanoCommandFailure(trovehost, 'config set')
+ raise GitanoCommandFailure(trovehost, 'config set')
def give_job_to_minion(self, statedb, lorry_info, now):
path = lorry_info['path']