Add extra check to ensure a build cannot be started without on_ready called
This commit is contained in:
parent
5e1a117ff3
commit
433b157531
1 changed files with 6 additions and 4 deletions
|
@ -70,13 +70,15 @@ class BuildComponent(BaseComponent):
|
||||||
|
|
||||||
yield From(self._set_status(ComponentStatus.WAITING))
|
yield From(self._set_status(ComponentStatus.WAITING))
|
||||||
|
|
||||||
def is_ready(self):
|
|
||||||
""" Determines whether a build component is ready to begin a build. """
|
|
||||||
return self._component_status == ComponentStatus.RUNNING
|
|
||||||
|
|
||||||
@trollius.coroutine
|
@trollius.coroutine
|
||||||
def start_build(self, build_job):
|
def start_build(self, build_job):
|
||||||
""" Starts a build. """
|
""" Starts a build. """
|
||||||
|
if self._component_status != ComponentStatus.RUNNING:
|
||||||
|
logger.debug('Could not start build for component %s (build %s, worker version: %s): %s',
|
||||||
|
self.builder_realm, build_job.repo_build.uuid, self._worker_version,
|
||||||
|
self._component_status)
|
||||||
|
raise Return()
|
||||||
|
|
||||||
logger.debug('Starting build for component %s (build %s, worker version: %s)',
|
logger.debug('Starting build for component %s (build %s, worker version: %s)',
|
||||||
self.builder_realm, build_job.repo_build.uuid, self._worker_version)
|
self.builder_realm, build_job.repo_build.uuid, self._worker_version)
|
||||||
|
|
||||||
|
|
Reference in a new issue