From 6306846b454a7e573a8c551c7ae885fb45e7cdae Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Fri, 22 Jun 2018 11:59:35 -0700 Subject: [PATCH] Log connection error details per-host Otherwise, you don't get much insight into why you had to settle for your third configured host. Now, you can get information like An error occurred while connecting to appliance foo.bar: [Errno -5] No address associated with hostname An error occurred while connecting to appliance localhost: [Errno 111] Connection refused even when we ultimately succeed in creating a client. --- kmip/services/kmip_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmip/services/kmip_client.py b/kmip/services/kmip_client.py index 547190e..043190e 100644 --- a/kmip/services/kmip_client.py +++ b/kmip/services/kmip_client.py @@ -224,7 +224,7 @@ class KMIPProxy: self.socket.connect((self.host, self.port)) except Exception as e: self.logger.error("An error occurred while connecting to " - "appliance " + self.host) + "appliance %s: %s", self.host, e) self.socket.close() last_error = e else: