RPC_backend / transport_url workover
- removed deprecated rabbitmq attributes - added rabbit_transport_url Change-Id: I19ff8e4df8f559bf03ff746fcc49be9425edd84e Depends-On: I0a6da37e3f2b839590b6349fd906d47c5206fbb3
This commit is contained in:
		 Christoph Albers
					Christoph Albers
				
			
				
					committed by
					
						 Jan Klare
						Jan Klare
					
				
			
			
				
	
			
			
			 Jan Klare
						Jan Klare
					
				
			
						parent
						
							a52e0e8d78
						
					
				
				
					commit
					68da464eae
				
			| @@ -4,7 +4,6 @@ default['openstack']['block-storage']['conf'].tap do |conf| | |||||||
|   if node['openstack']['block-storage']['syslog']['use'] |   if node['openstack']['block-storage']['syslog']['use'] | ||||||
|     conf['DEFAULT']['log_config'] = '/etc/openstack/logging.conf' |     conf['DEFAULT']['log_config'] = '/etc/openstack/logging.conf' | ||||||
|   end |   end | ||||||
|   conf['DEFAULT']['rpc_backend'] = node['openstack']['mq']['service_type'] |  | ||||||
|   conf['DEFAULT']['auth_strategy'] = 'keystone' |   conf['DEFAULT']['auth_strategy'] = 'keystone' | ||||||
|   conf['DEFAULT']['control_exchange'] = 'cinder' |   conf['DEFAULT']['control_exchange'] = 'cinder' | ||||||
|   conf['DEFAULT']['volume_group'] = 'cinder-volumes' |   conf['DEFAULT']['volume_group'] = 'cinder-volumes' | ||||||
|   | |||||||
| @@ -41,13 +41,8 @@ if node['openstack']['endpoints']['db']['enabled_slave'] | |||||||
|     db_uri('block-storage', db_user, db_pass, true) |     db_uri('block-storage', db_user, db_pass, true) | ||||||
| end | end | ||||||
|  |  | ||||||
| unless node['openstack']['block-storage']['conf']['DEFAULT']['rpc_backend'].nil? | if node['openstack']['mq']['service_type'] == 'rabbit' | ||||||
|   user = node['openstack']['mq']['block-storage']['rabbit']['userid'] |   node.default['openstack']['block-storage']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'block-storage' | ||||||
|   node.default['openstack']['block-storage']['conf_secrets'] |  | ||||||
|     .[]('oslo_messaging_rabbit')['rabbit_userid'] = user |  | ||||||
|   node.default['openstack']['block-storage']['conf_secrets'] |  | ||||||
|     .[]('oslo_messaging_rabbit')['rabbit_password'] = |  | ||||||
|     get_password 'user', user |  | ||||||
| end | end | ||||||
|  |  | ||||||
| glance_api_endpoint = internal_endpoint 'image_api' | glance_api_endpoint = internal_endpoint 'image_api' | ||||||
|   | |||||||
| @@ -192,8 +192,8 @@ describe 'openstack-block-storage::cinder-common' do | |||||||
|             expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen_port = 8776$/) |             expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen_port = 8776$/) | ||||||
|           end |           end | ||||||
|         end |         end | ||||||
|         it 'has default RPC/AMQP options set' do |         it 'has default transport_url/AMQP options set' do | ||||||
|           [/^rpc_backend = rabbit/].each do |line| |           [%r{^transport_url = rabbit://guest:mypass@127.0.0.1:5672$}].each do |line| | ||||||
|             expect(chef_run).to render_file(file.name).with_content(line) |             expect(chef_run).to render_file(file.name).with_content(line) | ||||||
|           end |           end | ||||||
|         end |         end | ||||||
| @@ -216,15 +216,6 @@ describe 'openstack-block-storage::cinder-common' do | |||||||
|             end |             end | ||||||
|           end |           end | ||||||
|  |  | ||||||
|           it 'has rabbit_userid' do |  | ||||||
|             node.set['openstack']['mq']['block-storage']['rabbit']['userid'] = 'rabbit_userid_value' |  | ||||||
|             expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_userid = rabbit_userid_value$/) |  | ||||||
|           end |  | ||||||
|  |  | ||||||
|           it 'has rabbit_password' do |  | ||||||
|             expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_password = #{test_pass}$/) |  | ||||||
|           end |  | ||||||
|  |  | ||||||
|           it 'has rabbit_virtual_host' do |           it 'has rabbit_virtual_host' do | ||||||
|             node.set['openstack']['block-storage']['conf']['oslo_messaging_rabbit']['rabbit_virtual_host'] = 'vhost_value' |             node.set['openstack']['block-storage']['conf']['oslo_messaging_rabbit']['rabbit_virtual_host'] = 'vhost_value' | ||||||
|             expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_virtual_host = vhost_value$/) |             expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_virtual_host = vhost_value$/) | ||||||
|   | |||||||
| @@ -58,6 +58,9 @@ shared_context 'block-storage-stubs' do | |||||||
|     allow_any_instance_of(Chef::Recipe).to receive(:get_password) |     allow_any_instance_of(Chef::Recipe).to receive(:get_password) | ||||||
|       .with('user', 'ibmnas_admin') |       .with('user', 'ibmnas_admin') | ||||||
|       .and_return('test_pass') |       .and_return('test_pass') | ||||||
|  |     allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url) | ||||||
|  |       .with('block-storage') | ||||||
|  |       .and_return('rabbit://guest:mypass@127.0.0.1:5672') | ||||||
|     allow(Chef::Application).to receive(:fatal!) |     allow(Chef::Application).to receive(:fatal!) | ||||||
|   end |   end | ||||||
| end | end | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user