From d5256e152d7f0dcea74a4bc5d411dd39152126d3 Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Thu, 29 Nov 2018 15:41:31 +0100 Subject: [PATCH] test: fix iSCSI target RPC config test for Python3 Python3 Exception don't have 'message' attribute so need to add it in RpcException class. This attribute has beed dropped in pep-0352. We should switch to str(e) instead in other places too. Change-Id: I610696b9e374e11ffa95327af6a10c6874915022 Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/435506 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- test/iscsi_tgt/rpc_config/rpc_config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/iscsi_tgt/rpc_config/rpc_config.py b/test/iscsi_tgt/rpc_config/rpc_config.py index dcb160e8f..62c7bfb7a 100755 --- a/test/iscsi_tgt/rpc_config/rpc_config.py +++ b/test/iscsi_tgt/rpc_config/rpc_config.py @@ -49,9 +49,10 @@ rpc_param = { class RpcException(Exception): - def __init__(self, retval, *args): - super(RpcException, self).__init__(*args) + def __init__(self, retval, msg): + super(RpcException, self).__init__(msg) self.retval = retval + self.message = msg class spdk_rpc(object):