diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-11-18 22:06:10 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-11-18 22:06:10 +0100 |
commit | 72c05cb232bc2eec173dba9b4c199703a180b651 (patch) | |
tree | eb2f132c877546b4c398d516856b564d6193c455 /ick2/workapi.py | |
parent | 1b4d3ab9cee0a47737aab8f4a603bb36e498ee0d (diff) | |
download | ick2-72c05cb232bc2eec173dba9b4c199703a180b651.tar.gz |
Refactor: move _start_log closer to where it is called
Diffstat (limited to 'ick2/workapi.py')
-rw-r--r-- | ick2/workapi.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ick2/workapi.py b/ick2/workapi.py index f6765f6..ccfbf71 100644 --- a/ick2/workapi.py +++ b/ick2/workapi.py @@ -95,6 +95,14 @@ class WorkAPI(ick2.APIbase): self._state.add_resource('builds', str(build_id), build) return build_id + def _start_log(self, build_id): + ick2.log.log('info', msg_text='Starting new log', build_id=build_id) + log = { + 'build_id': build_id, + 'log': '', + } + self._state.add_resource('log', str(build_id), log) + def update_work(self, update): if 'worker' not in update: # pragma: no cover raise ick2.BadUpdate('no worker specified') @@ -164,15 +172,6 @@ class WorkAPI(ick2.APIbase): return p, pl raise ick2.NotFound() - def _start_log(self, build_id): - ick2.log.log('info', msg_text='Starting new log', build_id=build_id) - log = { - 'build_id': build_id, - 'log': '', - } - self._state.add_resource('log', str(build_id), log) - return build_id - def _append_to_build_log(self, update): build_id = update['build_id'] log = self._state.get_resource('log', str(build_id)) |