Tim Landscheidt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/195556

Change subject: Tools: Fix XML output of qstat for webservice2
......................................................................

Tools: Fix XML output of qstat for webservice2

The output of "qstat -xml" can sometimes contain elements in the
"JATASK:" namespace without declaring that as such, thus producing
invalid XML.

In labs/toollabs's www/content/status.php, this is worked around by
piping qstat's output through sed.  For webservice2, this change fixes
the data directly in Python.

Bug: T92039
Change-Id: Id9af95152ebf3c386759fd0fc41960ca78cc9e96
---
M modules/toollabs/files/webservice2
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/56/195556/1

diff --git a/modules/toollabs/files/webservice2 
b/modules/toollabs/files/webservice2
index 6dcf3d4..4102543 100644
--- a/modules/toollabs/files/webservice2
+++ b/modules/toollabs/files/webservice2
@@ -94,6 +94,10 @@
     :return: Job id if the job is found, None otherwise
     """
     output = qstat_xml('-q', queue_name, '-j', job_name)
+
+    # Fix XML.
+    output = re.sub('JATASK:[^>]*', 'jatask', output)
+
     # GE is stupid.
     # Returns output like:
     # <><ST_name>blah</ST_name></>

-- 
To view, visit https://gerrit.wikimedia.org/r/195556
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9af95152ebf3c386759fd0fc41960ca78cc9e96
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Tim Landscheidt <t...@tim-landscheidt.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to