summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn R Barker <john@johnrbarker.com>2017-06-08 12:36:06 +0100
committerGitHub <noreply@github.com>2017-06-08 12:36:06 +0100
commitc5971f018fd6f5594a2b43aed7339be4b7fb2bb4 (patch)
treeedad608e97cbe477c3d6707c1eb3ae801cee8f17 /lib
parent8455251bec6d37ea01277907db48bdd3fcd32628 (diff)
downloadansible-c5971f018fd6f5594a2b43aed7339be4b7fb2bb4.tar.gz
RabbitMQ 3.6.7 changed a couple of response codes (#22715) (#25484)
(cherry picked from commit 6bd1681203e33d26d997a395d4581b12d2b81c37)
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/modules/messaging/rabbitmq_exchange.py3
-rw-r--r--lib/ansible/modules/messaging/rabbitmq_queue.py3
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 1ed33d305d..456d5e89e7 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 412182e21a..5a6f13d033 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']