Fix failing unit tests for new msgpack version

This fixes the failing unit tests with the newly msgpack
version.

Also depends on a requirements patch that bans pecan 1.4.0
that has broken gnocchi and hence ceilometer which uses
gnocchi as the default backend.

Task: 40652
Depends-on: https://review.opendev.org/746261
Change-Id: Id75b7d4004a50c588a22c7eeb46ad1d79ee7a189
This commit is contained in:
Rabi Mishra 2020-08-13 14:49:57 +05:30
parent 5af99caad7
commit f3b606889d
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ class UDPPublisher(publisher.ConfigPublisherBase):
"%(host)s:%(port)d", {'msg': msg, 'host': host,
'port': port})
try:
self.socket.sendto(msgpack.dumps(msg),
self.socket.sendto(msgpack.dumps(msg, use_bin_type=True),
(self.host, self.port))
except Exception as e:
LOG.warning(_("Unable to send sample over UDP"))

View File

@ -125,7 +125,7 @@ class TestUDPPublisher(base.BaseTestCase):
sent_counters = []
for data, dest in self.data_sent:
counter = msgpack.loads(data, encoding="utf-8")
counter = msgpack.loads(data, raw=False)
sent_counters.append(counter)
# Check destination