Commit 02fad467 authored by Łukasz Nowak's avatar Łukasz Nowak

taskdistribution: Wrap some strings into Binary

As there is no way to assure that stdout, stderr and html_test_result
will have XML-allowed characters, wrap them with xmlrpclib.Binary class, as
suggested in https://docs.python.org/2/library/xmlrpclib.html
parent 04534890
...@@ -171,9 +171,17 @@ class TestResultLineProxy(RPCRetry): ...@@ -171,9 +171,17 @@ class TestResultLineProxy(RPCRetry):
('duration', duration), ('duration', duration),
('date', date), ('date', date),
('command', command), ('command', command),
('stdout', stdout), # Wrap some strings into xmlrpclib.Binary, as they can contain
('stderr', stderr), # non-XML allowed characters
('html_test_result', html_test_result), ('stdout', xmlrpclib.Binary(stdout)
if isinstance(stdout, basestring)
else stdout),
('stderr', xmlrpclib.Binary(stderr)
if isinstance(stderr, basestring)
else stderr),
('html_test_result', xmlrpclib.Binary(html_test_result)
if isinstance(html_test_result, basestring)
else html_test_result),
) if x[1] is not None) ) if x[1] is not None)
if kw: if kw:
self._logger.info('Extra parameters provided: %r', kw) self._logger.info('Extra parameters provided: %r', kw)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment