From c5971f018fd6f5594a2b43aed7339be4b7fb2bb4 Mon Sep 17 00:00:00 2001 From: John R Barker Date: Thu, 8 Jun 2017 12:36:06 +0100 Subject: [PATCH] RabbitMQ 3.6.7 changed a couple of response codes (#22715) (#25484) (cherry picked from commit 6bd1681203e33d26d997a395d4581b12d2b81c37) --- lib/ansible/modules/messaging/rabbitmq_exchange.py | 3 ++- lib/ansible/modules/messaging/rabbitmq_queue.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/messaging/rabbitmq_exchange.py b/lib/ansible/modules/messaging/rabbitmq_exchange.py index 1ed33d305d1..456d5e89e74 100644 --- a/lib/ansible/modules/messaging/rabbitmq_exchange.py +++ b/lib/ansible/modules/messaging/rabbitmq_exchange.py @@ -204,7 +204,8 @@ def main(): elif module.params['state'] == 'absent': r = requests.delete( url, auth = (module.params['login_user'],module.params['login_password'])) - if r.status_code == 204: + # RabbitMQ 3.6.7 changed this response code from 204 to 201 + if r.status_code == 204 or r.status_code == 201: module.exit_json( changed = True, name = module.params['name'] diff --git a/lib/ansible/modules/messaging/rabbitmq_queue.py b/lib/ansible/modules/messaging/rabbitmq_queue.py index 412182e21a5..5a6f13d033f 100644 --- a/lib/ansible/modules/messaging/rabbitmq_queue.py +++ b/lib/ansible/modules/messaging/rabbitmq_queue.py @@ -250,7 +250,8 @@ def main(): elif module.params['state'] == 'absent': r = requests.delete( url, auth = (module.params['login_user'],module.params['login_password'])) - if r.status_code == 204: + # RabbitMQ 3.6.7 changed this response code from 204 to 201 + if r.status_code == 204 or r.status_code == 201: module.exit_json( changed = True, name = module.params['name']