Fix bug when no message is present

This commit is contained in:
Liam Young
2021-12-14 09:02:16 +00:00
parent 908f0b4a3b
commit 87c72a510e
@@ -506,9 +506,9 @@ def get_amqp_message_by_unit(unit, queue="test",
password=password)
channel = connection.channel()
method_frame, _, body = channel.basic_get(queue)
body = body.decode()
if method_frame:
body = body.decode()
logging.debug('Retreived message from {} queue:\n{}'.format(queue,
body))
channel.basic_ack(method_frame.delivery_tag)