Improve error message

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-10-10 20:51:30 +01:00
parent cb44e8887b
commit 0445f9ea39
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -308,12 +308,14 @@ class TCPPubClient(salt.transport.base.PublishClient):
self.unpacker = salt.utils.msgpack.Unpacker()
log.debug("PubClient conencted to %r %r", self, self.path)
except Exception as exc: # pylint: disable=broad-except
if self.path:
_connect_to = self.path
else:
_connect_to = f"{self.host}:{self.port}"
log.warning(
"TCP Publish Client encountered an exception while connecting to"
" %s:%s %s: %r, will reconnect in %d seconds",
self.host,
self.port,
self.path,
" %s: %r, will reconnect in %d seconds",
_connect_to,
exc,
self.backoff,
)