RabbitMQ-Binding - Allow empty routing key (#2674)

Fixes: #1985
This commit is contained in:
Manuel Sousa 2016-08-06 17:27:27 +01:00 committed by René Moser
parent 31a027e2cd
commit 73a3cd6aeb

View file

@ -127,6 +127,11 @@ def main():
else: else:
dest_type="e" 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" % ( url = "http://%s:%s/api/bindings/%s/e/%s/%s/%s/%s" % (
module.params['login_host'], module.params['login_host'],
module.params['login_port'], module.params['login_port'],
@ -134,7 +139,7 @@ def main():
urllib.quote(module.params['name'],''), urllib.quote(module.params['name'],''),
dest_type, dest_type,
urllib.quote(module.params['destination'],''), urllib.quote(module.params['destination'],''),
urllib.quote(module.params['routing_key'],'') props
) )
# Check if exchange already exists # Check if exchange already exists