mirror of https://github.com/OpenKMIP/PyKMIP.git
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:
parent
eb2fee80e8
commit
6306846b45
|
@ -224,7 +224,7 @@ class KMIPProxy:
|
||||||
self.socket.connect((self.host, self.port))
|
self.socket.connect((self.host, self.port))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.error("An error occurred while connecting to "
|
self.logger.error("An error occurred while connecting to "
|
||||||
"appliance " + self.host)
|
"appliance %s: %s", self.host, e)
|
||||||
self.socket.close()
|
self.socket.close()
|
||||||
last_error = e
|
last_error = e
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue