Nir Soffer has posted comments on this change. Change subject: jsonrpc: provide more info when method not found ......................................................................
Patch Set 4: (2 comments) https://gerrit.ovirt.org/#/c/53714/4/lib/yajsonrpc/__init__.py File lib/yajsonrpc/__init__.py: Line 63: class JsonRpcMethodNotFoundError(JsonRpcError): Line 64: def __init__(self, method_name): Line 65: JsonRpcError.__init__( Line 66: self, -32601, Line 67: "The method %s does not exist or is not available." % method_name) Better use %r - if the error is leading or trailing whitespace, or non-printable character in the method name, %r will expose this. This is true for most logs where you want to show user provided string. Line 68: Line 69: Line 70: class JsonRpcInvalidParamsError(JsonRpcError): Line 71: def __init__(self): https://gerrit.ovirt.org/#/c/53714/4/tests/integration/jsonRpcTests.py File tests/integration/jsonRpcTests.py: Line 138: with constructClient(self.log, bridge, ssl, type) as clientFactory: Line 139: with self._client(clientFactory) as client: Line 140: if type == "xml": Line 141: response = client.send(missing_method, ()) Line 142: self.assertTrue("\"I_DO_NOT_EXIST :(\" is not supported" Why not: self.assertNotIn(missing_method, response) ? Line 143: in response) Line 144: else: Line 145: with self.assertRaises(JsonRpcError) as cm: Line 146: self._callTimeout(client, missing_method, [], -- To view, visit https://gerrit.ovirt.org/53714 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib29240f002ab7c11744d164cf4e0ea5f47924929 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Piotr Kliczewski <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Piotr Kliczewski <[email protected]> Gerrit-Reviewer: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: gerrit-hooks <[email protected]> Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
