diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-11-06 08:35:00 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-11-06 08:35:00 +0100 |
commit | f1e2fdbfaa4f18c662a75941437d1ae46c6ca89f (patch) | |
tree | ece48bc001959d2f78f60e944ad4e9061222d0c9 /ick2/controllerapi.py | |
parent | 5409e8335c7adce34b61875be3dc7008c8c4f117 (diff) | |
download | ick2-f1e2fdbfaa4f18c662a75941437d1ae46c6ca89f.tar.gz |
Refactor: how a pipeline step is finished
Diffstat (limited to 'ick2/controllerapi.py')
-rw-r--r-- | ick2/controllerapi.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py index 1fea9a0..a7d5fb5 100644 --- a/ick2/controllerapi.py +++ b/ick2/controllerapi.py @@ -380,15 +380,25 @@ class WorkAPI(APIbase): project, pipeline = self._get_pipeline( update['project'], update['pipeline']) + ick2.log.log( + 'trace', + msg_text='xxx update_work', + update=update, + project=project, + pipeline=pipeline, + doing=doing) + if update.get('exit_code') == 0: + ick2.log.log('trace', msg_texg='xxx finishing step') index = doing['step_index'] + 1 actions = pipeline['actions'] if index >= len(actions): - self._finish_pipeline(project, pipeline) + pipeline['status'] = 'idle' doing = {} else: doing['step_index'] = index doing['step'] = actions[index] + self._update_project(project) worker_state = { 'worker': update['worker'], @@ -414,10 +424,6 @@ class WorkAPI(APIbase): return p, pl raise ick2.NotFound() - def _finish_pipeline(self, project, pipeline): - pipeline['status'] = 'idle' - self._update_project(project) - def create(self, *args, **kwargs): # pragma: no cover pass |