Fixes issues with `rabbit_transport_url` method

When using rabbit_transport_url in a multi node environment, the address
used is the bind_address if we do not use a mq cluster, where it should
be the rabbit server endpoint hostname, if not we can end up with some
transport_url configurations as rabbit://<...>@0.0.0.0:<...>, if the
rabbit server is configured to listen on all interfaces.

Change-Id: I617f54030ca3610638e6fd1bd3215dc2e7b23841
Signed-off-by: Manuel Torrinha <manuel.torrinha@tecnico.ulisboa.pt>
This commit is contained in:
Manuel Torrinha 2019-10-23 17:29:45 +01:00
parent e51294e5a2
commit cace34613e
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ module ::Openstack
mq_password = get_password 'user', mq_user
mq_port = node['openstack']['endpoints']['mq']['port']
vhost = node['openstack']['mq']['vhost']
bind_mq_address = bind_address node['openstack']['bind_service']['mq']
mq_host = node['openstack']['endpoints']['mq']['host']
url = 'rabbit://'
if node['openstack']['mq']['cluster']
node['openstack']['mq']['servers'].each do |server|
@ -44,7 +44,7 @@ module ::Openstack
url += ',' unless node['openstack']['mq']['servers'].last == server
end
else
url += "#{mq_user}:#{mq_password}@#{bind_mq_address}:#{mq_port}"
url += "#{mq_user}:#{mq_password}@#{mq_host}:#{mq_port}"
end
url += vhost
url