From 5f8dba2024cd465f9fc9ca98e67e4089caa4bfd2 Mon Sep 17 00:00:00 2001 From: Alexander Indenbaum Date: Sun, 19 Nov 2023 11:55:30 +0200 Subject: [PATCH] Issue 323 ceph-nvmeof-nvmeof-1 | File "/src/control/discovery.py", line 873, in _state_notify_update ceph-nvmeof-nvmeof-1 | async_reply.dword0 = b'\x02\xf0\x70\x00' ceph-nvmeof-nvmeof-1 | TypeError: an integer is required (got type bytes) Signed-off-by: Alexander Indenbaum --- control/discovery.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/control/discovery.py b/control/discovery.py index 652cbef8..81d85f6b 100644 --- a/control/discovery.py +++ b/control/discovery.py @@ -865,14 +865,19 @@ def _state_notify_update(self, update, is_add_req): for key in list(self.conn_vals.keys()): if self.conn_vals[key].recv_async is True: + pdu_reply = Pdu() + pdu_reply.type = NVME_TCP_PDU.RSP + pdu_reply.header_length = 24 + pdu_reply.packet_length = 24 + async_reply = CqeNVMe() # async_event_type:0x2 async_event_info:0xf0 log_page_identifier:0x70 - async_reply.dword0 = b'\x02\xf0\x70\x00' + async_reply.dword0 = int.from_bytes(b'\x02\xf0\x70\x00', byteorder='little') async_reply.sq_head_ptr = self.conn_vals[key].sq_head_ptr async_reply.cmd_id = self.conn_vals[key].async_cmd_id try: - self.conn_vals[key].connection.sendall(async_reply) + self.conn_vals[key].connection.sendall(pdu_reply + async_reply) except BrokenPipeError: self.logger.error("client disconnected unexpectedly.") return -1