Add rabbit/qpid notification_topic attribute to template

- Utilise the rabbit/qpid notification_topic attributes from
  openstack-common in the glance-api.conf.erb template.
- Write tests to confirm these attributes are set.

Change-Id: Ia939d25dae0d0ee5bbe53777893807ed8b61d579
Closes-Bug: #1274879
This commit is contained in:
Andy McCrae
2014-02-14 13:25:23 +00:00
parent 46b1cf80e2
commit 9f590f87cd
2 changed files with 14 additions and 2 deletions

View File

@@ -166,6 +166,7 @@ describe 'openstack-image::api' do
before do
node.set['openstack']['mq']['image']['notifier_strategy'] = 'rabbit'
node.set['openstack']['mq']['image']['service_type'] = 'rabbitmq'
node.set['openstack']['mq']['image']['notification_topic'] = 'rabbit_topic'
end
it 'has rabbit_host' do
@@ -192,6 +193,11 @@ describe 'openstack-image::api' do
match = 'rabbit_virtual_host = /'
expect(chef_run).to render_file(file.name).with_content(match)
end
it 'has rabbit_notification_topic' do
match = 'rabbit_notification_topic = rabbit_topic'
expect(chef_run).to render_file(file.name).with_content(match)
end
end
describe 'qpid' do
@@ -200,6 +206,7 @@ describe 'openstack-image::api' do
before do
node.set['openstack']['mq']['image']['notifier_strategy'] = 'qpid'
node.set['openstack']['mq']['image']['service_type'] = 'qpid'
node.set['openstack']['mq']['image']['notification_topic'] = 'qpid_topic'
end
it 'has qpid_hostname' do
@@ -271,6 +278,11 @@ describe 'openstack-image::api' do
match = 'qpid_tcp_nodelay=true'
expect(chef_run).to render_file(file.name).with_content(match)
end
it 'has qpid_notification_topic' do
match = 'qpid_notification_topic = qpid_topic'
expect(chef_run).to render_file(file.name).with_content(match)
end
end
describe 'glance-api-paste.ini' do

View File

@@ -113,12 +113,12 @@ rabbit_userid = <%= node["openstack"]["mq"]["image"]["rabbit"]["userid"] %>
rabbit_password = <%= @mq_password %>
rabbit_virtual_host = <%= node["openstack"]["mq"]["image"]["rabbit"]["vhost"] %>
rabbit_notification_exchange = glance
rabbit_notification_topic = glance_notifications
rabbit_notification_topic = <%= node["openstack"]["mq"]["image"]["rabbit"]["notification_topic"] %>
<% elsif @notifier_strategy == "qpid" and @mq_service_type == "qpid" %>
##### QPID #####
rpc_backend=nova.openstack.common.rpc.impl_qpid
qpid_notification_exchange = glance
qpid_notification_topic = glance_notifications
qpid_notification_topic = <%= node["openstack"]["mq"]["image"]["qpid"]["notification_topic"] %>
qpid_hostname=<%= node["openstack"]["mq"]["image"]["qpid"]["host"] %>
qpid_port=<%= node["openstack"]["mq"]["image"]["qpid"]["port"] %>