mirror of
https://github.com/openkmip/pykmip
synced 2026-01-06 10:33:35 +00:00
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.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user