scripts/rpc.py: add parentheses to all print calls

This is necessary for rpc.py to work with Python 3.

Change-Id: I34d411090532ccc2603473ded20119681f8aa85a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404433
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Daniel Verkamp 2018-03-19 17:40:09 -07:00 committed by Jim Harris
parent 0126c9ce7a
commit e78866edf0
2 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,7 @@ except ImportError:
def print_array(a):
print " ".join((quote(v) for v in a))
print(" ".join((quote(v) for v in a)))
if __name__ == "__main__":

View File

@ -4,7 +4,7 @@ import time
def print_dict(d):
print json.dumps(d, indent=2)
print(json.dumps(d, indent=2))
class JSONRPCClient(object):
@ -70,17 +70,17 @@ class JSONRPCClient(object):
if method == "kill_instance":
exit(0)
if closed:
print "Connection closed with partial response:"
print("Connection closed with partial response:")
else:
print "Timeout while waiting for response:"
print buf
print("Timeout while waiting for response:")
print(buf)
exit(1)
if 'error' in response:
print "Got JSON-RPC error response"
print "request:"
print("Got JSON-RPC error response")
print("request:")
print_dict(json.loads(reqstr))
print "response:"
print("response:")
print_dict(response['error'])
exit(1)