Commit 5bd76a10 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

rpc.py: expliclty print the exception's message



This worked fine as-is with Python 3.  But when
trying to run rpc.py with Python 2, it was noted
that simply doing print(ex) didn't print the message,
it needs to be print(ex.message).

Note that the similar code for printing the exception
message when running an RPC script was already doing
print(ex.message), so this change also makes the
code more consistent.

We aren't supporting or testing rpc.py with Python 2,
and there are some fairly significant mods required
to get it to work, but this small change at least
reduces that effort for those needing to implement
it and maintain it themselves.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I0a6c94889dc631ef33835433f20f35ddc738aafb

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476633


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
parent 8bc9798d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2301,7 +2301,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
        try:
            call_rpc_func(args)
        except JSONRPCException as ex:
            print(ex)
            print(ex.message)
            exit(1)
    elif sys.stdin.isatty():
        # No arguments and no data piped through stdin