From bb7dfc81386c65bf21dc0d11aa9ccc011488ed97 Mon Sep 17 00:00:00 2001 From: Gil Bregman Date: Sun, 2 Jun 2024 13:51:58 +0300 Subject: [PATCH] Fix typo in log message and make sure address family is not empty. Fixes #694 Signed-off-by: Gil Bregman --- control/grpc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/control/grpc.py b/control/grpc.py index 855ca2eb..c93e639a 100644 --- a/control/grpc.py +++ b/control/grpc.py @@ -2054,10 +2054,14 @@ def list_connections_safe(self, request, context): trtype = addr["trtype"].upper() except Exception: pass + if not trtype: + trtype = "TCP" try: adrfam = addr["adrfam"].lower() except Exception: pass + if not adrfam: + adrfam = "ipv4" break except Exception: self.logger.exception(f"Got exception while parsing qpair: {qp}") @@ -2069,7 +2073,7 @@ def list_connections_safe(self, request, context): if hostnqn in host_nqns: host_nqns.remove(hostnqn) except Exception: - self.logger.exception(f"{con=} parse error") + self.logger.exception(f"{conn=} parse error") pass for nqn in host_nqns: