If a server returned an error in response to a request,
transact_block() would ignore it.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
reply = None
while not error:
error, reply = self.recv_block()
- if reply and reply.type == Message.T_REPLY and reply.id == id_:
+ if (reply
+ and (reply.type == Message.T_REPLY
+ or reply.type == Message.T_ERROR)
+ and reply.id == id_):
break
return error, reply
sys.stderr.write("jsonrpc transaction failed: %s"
% os.strerror(error))
sys.exit(1)
+ elif reply.error is not None:
+ sys.stderr.write("jsonrpc transaction failed: %s"
+ % reply.error)
+ sys.exit(1)
+
sys.stdout.write("%03d: " % step)
sys.stdout.flush()
step += 1