diff options
author | Zuul <zuul@review.opendev.org> | 2023-04-24 15:52:29 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2023-04-24 15:52:29 +0000 |
commit | da679054bd5e11035c1f778e386392449cdafba5 (patch) | |
tree | 15290f4a639644682f707cfdd9ac015deb6f63b1 | |
parent | 6e339d3e74df5460d372b3e2abce27664ddb1100 (diff) | |
parent | 8699146e1aee5bbd5b65a96c4109b6c02b0e1fe1 (diff) | |
download | ceilometer-da679054bd5e11035c1f778e386392449cdafba5.tar.gz |
Merge "Make TCP publisher log warning instead of failing."
-rw-r--r-- | ceilometer/publisher/tcp.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ceilometer/publisher/tcp.py b/ceilometer/publisher/tcp.py index ef5e802d..5dac5f91 100644 --- a/ceilometer/publisher/tcp.py +++ b/ceilometer/publisher/tcp.py @@ -51,7 +51,11 @@ class TCPPublisher(publisher.ConfigPublisherBase): "Cannot resolve host %s, creating AF_INET socket...", self.host) self.addr_family = socket.AF_INET - self.create_and_connect() + try: + self.create_and_connect() + except Exception: + LOG.error(_("Unable to connect to the " + "remote endpoint")) def create_and_connect(self): self.socket = socket.socket(self.addr_family, @@ -77,8 +81,8 @@ class TCPPublisher(publisher.ConfigPublisherBase): try: self.socket.send(msg_len + encoded_msg) except Exception: - LOG.warning(_("Unable to send sample over TCP," - "trying to reconnect and resend the message")) + LOG.error(_("Unable to send sample over TCP," + "trying to reconnect and resend the message")) self.create_and_connect() try: self.socket.send(msg_len + encoded_msg) |