Dan Kenigsberg has posted comments on this change.
Change subject: xmlrpc: Parsing error logging enhancement - vdsClient
......................................................................
Patch Set 6: Code-Review-1
(3 comments)
....................................................
File lib/vdsm/vdscli.py.in
Line 35:
Line 36:
Line 37: class TransportWrapper:
Line 38: def __init__(self, transport):
Line 39: self._parse = transport.parse_response
calling this "_parse" is confusing. it is the original parse_response, so
_orig_parse_response is a much clearer name.
Line 40: transport.parse_response = types.MethodType(
Line 41: self.wrapped_parse_response,
Line 42: transport)
Line 43:
Line 42: transport)
Line 43:
Line 44: def wrapped_parse_response(self, *args, **kwargs):
Line 45: try:
Line 46: return self._parse(args[1])
pass everything to the called function with _parse(*args, **kwargs).
Line 47: except ExpatError as e:
Line 48: sys.stderr.write('Parsing error was thrown during parsing '
Line 49: 'response when provided:
{}'.format(args[1]))
Line 50: raise e
Line 46: return self._parse(args[1])
Line 47: except ExpatError as e:
Line 48: sys.stderr.write('Parsing error was thrown during parsing '
Line 49: 'response when provided:
{}'.format(args[1]))
Line 50: raise e
use a simple "raise" to maintain traceback.; no need to mention "e" at all.
Line 51:
Line 52:
Line 53: class SingleRequestTransport(xmlrpclib.Transport):
Line 54: '''Python 2.7 Transport introduced a change that makes it reuse
connections
--
To view, visit http://gerrit.ovirt.org/20627
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ife29c4f7749b9cd8a4ad892f486d91509e505ae4
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: mooli tayer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches