summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@hp.com>2015-05-07 10:29:26 -0700
committerJames E. Blair <jeblair@hp.com>2015-05-07 10:29:26 -0700
commitbb681360fcbcbb9a9b53f7e0fc02a752996a3cf3 (patch)
tree80a7c28f0e71271ea29061da9ecacb9a21c5ea06
parent9035599e90190abc2bc834dd0478fc4a9ba3498f (diff)
downloadgear-bb681360fcbcbb9a9b53f7e0fc02a752996a3cf3.tar.gz
Fix regression in wakeConnections0.5.7
In d5e03ac9307c9cc6f79fc22f15e177d3662dc936, an optional argument to wakeConnections was added so that only connections related to a job would be awoken. However, the default value, None, meant that no connection would be awoken. This doesn't make much sense, and indeed, Zuul, in its unit tests, was relying on all connections being awoken. Fix this by awakening all connections if the job argument is None (which never happens within gear itself). Change-Id: Ib7632ae0353c414cc1b68dbe430cb57292058012
-rw-r--r--gear/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gear/__init__.py b/gear/__init__.py
index b4306a4..51c0c91 100644
--- a/gear/__init__.py
+++ b/gear/__init__.py
@@ -2950,7 +2950,8 @@ class Server(BaseClientServer):
p = Packet(constants.RES, constants.NOOP, b'')
for connection in self.active_connections:
if connection.state == 'SLEEP':
- if job and job.name in connection.functions:
+ if ((job and job.name in connection.functions) or
+ (job is None)):
connection.changeState("AWAKE")
connection.sendPacket(p)