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:
parent
0126c9ce7a
commit
e78866edf0
@ -12,7 +12,7 @@ except ImportError:
|
|||||||
|
|
||||||
|
|
||||||
def print_array(a):
|
def print_array(a):
|
||||||
print " ".join((quote(v) for v in a))
|
print(" ".join((quote(v) for v in a)))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -4,7 +4,7 @@ import time
|
|||||||
|
|
||||||
|
|
||||||
def print_dict(d):
|
def print_dict(d):
|
||||||
print json.dumps(d, indent=2)
|
print(json.dumps(d, indent=2))
|
||||||
|
|
||||||
|
|
||||||
class JSONRPCClient(object):
|
class JSONRPCClient(object):
|
||||||
@ -70,17 +70,17 @@ class JSONRPCClient(object):
|
|||||||
if method == "kill_instance":
|
if method == "kill_instance":
|
||||||
exit(0)
|
exit(0)
|
||||||
if closed:
|
if closed:
|
||||||
print "Connection closed with partial response:"
|
print("Connection closed with partial response:")
|
||||||
else:
|
else:
|
||||||
print "Timeout while waiting for response:"
|
print("Timeout while waiting for response:")
|
||||||
print buf
|
print(buf)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if 'error' in response:
|
if 'error' in response:
|
||||||
print "Got JSON-RPC error response"
|
print("Got JSON-RPC error response")
|
||||||
print "request:"
|
print("request:")
|
||||||
print_dict(json.loads(reqstr))
|
print_dict(json.loads(reqstr))
|
||||||
print "response:"
|
print("response:")
|
||||||
print_dict(response['error'])
|
print_dict(response['error'])
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user