From cace34613e8e5c0101303d60130048e167e28b35 Mon Sep 17 00:00:00 2001 From: Manuel Torrinha Date: Wed, 23 Oct 2019 17:29:45 +0100 Subject: [PATCH] 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 --- libraries/endpoints.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/endpoints.rb b/libraries/endpoints.rb index 46bf5765..c2c53119 100644 --- a/libraries/endpoints.rb +++ b/libraries/endpoints.rb @@ -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