From 60bf34d1f0dbd07af781ccef5fe5ffa3c51db46d Mon Sep 17 00:00:00 2001 From: Vitaliy Mysak Date: Tue, 16 Jul 2019 23:05:00 +0000 Subject: [PATCH] scripts/rpc: change default value from None to {} JSONRPCClient.call recieved optional `params` value, but then `params` was used in `json.dumps` function (line #159) as a dictionary, so `None` was treated as dictionary in some cases, which resulted in TypeError. This patch fixes above issue by changing the default value from `None` to `{}`. Change-Id: I27ca0ccc2d970c0ff9e8117f02203c03e417adf0 Signed-off-by: Vitaliy Mysak Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462070 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Shuhei Matsumoto --- scripts/rpc/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/rpc/client.py b/scripts/rpc/client.py index 982077554..41395a5c4 100644 --- a/scripts/rpc/client.py +++ b/scripts/rpc/client.py @@ -141,7 +141,7 @@ class JSONRPCClient(object): self._logger.info("response:\n%s\n", json.dumps(response, indent=2)) return response - def call(self, method, params=None): + def call(self, method, params={}): self._logger.debug("call('%s')" % method) req_id = self.send(method, params) try: