From 87c9514565ca92c1df2e269e54a1588c6a5e5230 Mon Sep 17 00:00:00 2001 From: John Imison <857198+Im0@users.noreply.github.com> Date: Wed, 11 Sep 2019 16:23:27 +1000 Subject: [PATCH] lookup_rabbitmq pika > 1.0.0 is_closing bug fix (#61959) * In pika v1.0.0 BlockingChannel.is_closing was removed. Updating plugin accordingly. Ref: https://github.com/pika/pika/pull/1034 * Adding change fragment for is_closing bug. * Updated change fragment description. (cherry picked from commit 9b149917a63ead90f49918632cb64ea2892f50da) --- changelogs/fragments/lookup_rabbitmq-is_closing-bug.yml | 2 ++ lib/ansible/plugins/lookup/rabbitmq.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/lookup_rabbitmq-is_closing-bug.yml diff --git a/changelogs/fragments/lookup_rabbitmq-is_closing-bug.yml b/changelogs/fragments/lookup_rabbitmq-is_closing-bug.yml new file mode 100644 index 0000000000..57eac0175f --- /dev/null +++ b/changelogs/fragments/lookup_rabbitmq-is_closing-bug.yml @@ -0,0 +1,2 @@ +bugfixes: + - rabbitmq lookup plugin - Fix for rabbitmq lookups failing when using pika v1.0.0 and newer. diff --git a/lib/ansible/plugins/lookup/rabbitmq.py b/lib/ansible/plugins/lookup/rabbitmq.py index 2596359c9b..7c2745f41d 100644 --- a/lib/ansible/plugins/lookup/rabbitmq.py +++ b/lib/ansible/plugins/lookup/rabbitmq.py @@ -180,7 +180,7 @@ class LookupModule(LookupBase): else: break - if connection.is_closing or connection.is_closed: + if connection.is_closed: return [ret] else: try: