diff --git a/attributes/nova_conf.rb b/attributes/nova_conf.rb index 2774ac2e..7fe63a9d 100644 --- a/attributes/nova_conf.rb +++ b/attributes/nova_conf.rb @@ -7,7 +7,6 @@ default['openstack']['compute']['conf'].tap do |conf| conf['DEFAULT']['state_path'] = '/var/lib/nova' conf['DEFAULT']['compute_driver'] = 'libvirt.LibvirtDriver' conf['DEFAULT']['auth_version'] = node['openstack']['api']['auth']['version'] - conf['DEFAULT']['rpc_backend'] = node['openstack']['mq']['service_type'] conf['DEFAULT']['instances_path'] = "#{node['openstack']['compute']['conf']['DEFAULT']['state_path']}/instances" conf['DEFAULT']['enabled_apis'] = 'osapi_compute' if node['openstack']['compute']['syslog']['use'] #= false diff --git a/recipes/nova-common.rb b/recipes/nova-common.rb index 332f781e..ae8b18ee 100644 --- a/recipes/nova-common.rb +++ b/recipes/nova-common.rb @@ -94,13 +94,8 @@ if node['openstack']['endpoints']['db']['enabled_slave'] db_uri('compute_api', api_db_user, api_db_pass, true) end -if node['openstack']['compute']['conf']['DEFAULT']['rpc_backend'] == 'rabbit' - user = node['openstack']['mq']['compute']['rabbit']['userid'] - node.default['openstack']['compute']['conf_secrets'] - .[]('oslo_messaging_rabbit')['rabbit_userid'] = user - node.default['openstack']['compute']['conf_secrets'] - .[]('oslo_messaging_rabbit')['rabbit_password'] = - get_password 'user', user +if node['openstack']['mq']['service_type'] == 'rabbit' + node.default['openstack']['compute']['conf_secrets']['DEFAULT']['transport_url'] = rabbit_transport_url 'compute' end memcache_servers = memcached_servers.join ',' diff --git a/spec/nova-common_spec.rb b/spec/nova-common_spec.rb index 9a6069ab..620d1a23 100644 --- a/spec/nova-common_spec.rb +++ b/spec/nova-common_spec.rb @@ -92,8 +92,8 @@ describe 'openstack-compute::nova-common' do end end - it 'has default RPC/AMQP options set' do - [/^rpc_backend = rabbit$/].each do |line| + it 'has default transport_url/AMQP options set' do + [%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) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 37f92e7a..b3ce056f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -73,9 +73,9 @@ shared_context 'compute_stubs' do allow_any_instance_of(Chef::Recipe).to receive(:get_password) .with('service', 'rbd_block_storage') .and_return 'cinder-rbd-pass' - # allow_any_instance_of(Chef::Recipe).to receive(:get_password) - # .with('service', 'openstack-bare-metal') - # .and_return 'ironic-pass' + allow_any_instance_of(Chef::Recipe).to receive(:rabbit_transport_url) + .with('compute') + .and_return('rabbit://guest:mypass@127.0.0.1:5672') allow_any_instance_of(Chef::Recipe).to receive(:memcached_servers).and_return [] allow(Chef::Application).to receive(:fatal!) allow(SecureRandom).to receive(:hex).and_return('ad3313264ea51d8c6a3d1c5b140b9883')