From a6fa08c19c15b3a52c6842ab4c4c286be4684617 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 29 Jan 2015 18:21:32 -0500 Subject: [PATCH] Change returns to trollius returns --- buildman/component/buildcomponent.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/buildman/component/buildcomponent.py b/buildman/component/buildcomponent.py index d2df26ec9..cd5c4b4e8 100644 --- a/buildman/component/buildcomponent.py +++ b/buildman/component/buildcomponent.py @@ -294,7 +294,7 @@ class BuildComponent(BaseComponent): version) raise trollius.Return(False) - if self._component_status != 'waiting': + if self._component_status != 'waiting5': logger.warning('Build component (token "%s") is already connected', self.expected_token) raise trollius.Return(False) @@ -334,7 +334,7 @@ class BuildComponent(BaseComponent): # If the component is no longer running or actively building, nothing more to do. if (self._component_status != ComponentStatus.RUNNING and self._component_status != ComponentStatus.BUILDING): - return + raise trollius.Return() # If there is an active build, write the heartbeat to its status. build_status = self._build_status @@ -352,12 +352,15 @@ class BuildComponent(BaseComponent): if (self._last_heartbeat and self._last_heartbeat < datetime.datetime.utcnow() - HEARTBEAT_DELTA): yield trollius.From(self._timeout()) - return + raise trollius.Return() yield trollius.From(trollius.sleep(HEARTBEAT_TIMEOUT)) @trollius.coroutine def _timeout(self): + if self._component_status == ComponentStatus.TIMED_OUT: + raise trollius.Return() + yield trollius.From(self._set_status(ComponentStatus.TIMED_OUT)) logger.warning('Build component with realm %s has timed out', self.builder_realm)