Hashar has submitted this change and it was merged.
Change subject: Support spaces in Gearman functions names
......................................................................
Support spaces in Gearman functions names
Jenkins allow spaces in its job names, when splitting the Gearman status
flow, nodepool uses split() which includes both spaces and tabs. That
causes an exception:
...
File "nodepool/nodepool.py", line 1565, in getNeededNodes
label_demand = self.gearman_client.getNeededWorkers()
File "nodepool/nodepool.py", line 255, in getNeededWorkers
queued = int(parts[1]) - int(parts[2])
ValueError: invalid literal for int() with base 10: 'Dashboard'
That is caused by a job named 'Global-Dev Dashboard Data' with the
status output being:
build:Global-Dev Dashboard Data<TAB>0<TAB>0<TAB>23
Since Gearman uses tab separated fields, explicitly split on tabs.
Change-Id: I72c49409808251ce87a55f8b6f444b6f57120550
---
M nodepool/nodepool.py
1 file changed, 1 insertion(+), 1 deletion(-)
Objections:
Hashar: Do not submit
diff --git a/nodepool/nodepool.py b/nodepool/nodepool.py
index ec0e373..541ec35 100644
--- a/nodepool/nodepool.py
+++ b/nodepool/nodepool.py
@@ -249,7 +249,7 @@
self._lostConnection(connection)
continue
for line in req.response.split('\n'):
- parts = [x.strip() for x in line.split()]
+ parts = [x.strip() for x in line.split('\t')]
if not parts or parts[0] == '.':
continue
if not parts[0].startswith('build:'):
--
To view, visit https://gerrit.wikimedia.org/r/205564
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I72c49409808251ce87a55f8b6f444b6f57120550
Gerrit-PatchSet: 6
Gerrit-Project: operations/debs/nodepool
Gerrit-Branch: patch-queue/debian
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits