summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Sousa <manuel.sousa@gmail.com>2016-08-06 17:27:27 +0100
committerRené Moser <mail@renemoser.net>2016-08-06 18:27:27 +0200
commit73a3cd6aebc85b0f0882b5aad2a83e2d61f54f80 (patch)
tree99685876c58d60fd06fadd2ca629364d0d9e0f26
parent31a027e2cd68f78223d170fb82328f0de3b1abe4 (diff)
downloadansible-modules-extras-73a3cd6aebc85b0f0882b5aad2a83e2d61f54f80.tar.gz
RabbitMQ-Binding - Allow empty routing key (#2674)
Fixes: #1985
-rw-r--r--messaging/rabbitmq_binding.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/messaging/rabbitmq_binding.py b/messaging/rabbitmq_binding.py
index ad7fa151..2768095b 100644
--- a/messaging/rabbitmq_binding.py
+++ b/messaging/rabbitmq_binding.py
@@ -127,6 +127,11 @@ def main():
else:
dest_type="e"
+ if module.params['routing_key'] == "":
+ props = "~"
+ else:
+ props = urllib.quote(module.params['routing_key'],'')
+
url = "http://%s:%s/api/bindings/%s/e/%s/%s/%s/%s" % (
module.params['login_host'],
module.params['login_port'],
@@ -134,7 +139,7 @@ def main():
urllib.quote(module.params['name'],''),
dest_type,
urllib.quote(module.params['destination'],''),
- urllib.quote(module.params['routing_key'],'')
+ props
)
# Check if exchange already exists