summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-02-09 18:21:49 +0200
committerLars Wirzenius <liw@liw.fi>2018-02-09 18:21:49 +0200
commit091acf40ce2ac7b46e7b5cb94c7fae625e86d2ae (patch)
tree60b5c575ee427460a3c311ccafdef16696c07b35
parenta2d623eaa6f09813c05cff02c57b713897bcebb4 (diff)
downloadick2-091acf40ce2ac7b46e7b5cb94c7fae625e86d2ae.tar.gz
Fix: if registration fails, abort
-rwxr-xr-xworker_manager4
1 files changed, 3 insertions, 1 deletions
diff --git a/worker_manager b/worker_manager
index 3552450..ad51619 100755
--- a/worker_manager
+++ b/worker_manager
@@ -131,7 +131,9 @@ class ControllerAPI:
body = {
'worker': self._name,
}
- self._httpapi.post(url, headers, body)
+ code = self._httpapi.post(url, headers, body)
+ if code not in [200, 201, 409]:
+ raise cliapp.AppException('Failed to register worker')
def get_work(self):
url = self.url('/work/{}'.format(self._name))