From 37a4707015795be87c4e68a350de466335d8486b Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Wed, 13 Apr 2016 14:41:44 -0500 Subject: [PATCH] Cleanup options deprecated for mitaka Some options have been deprecated for Mitaka, replace them with the new variants. Change-Id: I7563c8cac90d9caa0095944d8c0835d73f1b8dde --- attributes/cinder_conf.rb | 4 ++-- spec/api_spec.rb | 3 +-- spec/scheduler_spec.rb | 3 +-- spec/spec_helper.rb | 25 ++++++++++++++++++++++++- spec/volume_spec.rb | 3 +-- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/attributes/cinder_conf.rb b/attributes/cinder_conf.rb index c42a3c5..9e16ece 100644 --- a/attributes/cinder_conf.rb +++ b/attributes/cinder_conf.rb @@ -1,6 +1,6 @@ default['openstack']['block-storage']['conf_secrets'] = {} default['openstack']['block-storage']['conf'].tap do |conf| - conf['DEFAULT']['notification_driver'] = 'cinder.openstack.common.notifier.rpc_notifier' + conf['oslo_messaging_notifications']['driver'] = 'cinder.openstack.common.notifier.rpc_notifier' if node['openstack']['block-storage']['syslog']['use'] conf['DEFAULT']['log_config'] = '/etc/openstack/logging.conf' end @@ -9,7 +9,7 @@ default['openstack']['block-storage']['conf'].tap do |conf| conf['DEFAULT']['control_exchange'] = 'cinder' conf['DEFAULT']['volume_group'] = 'cinder-volumes' conf['DEFAULT']['state_path'] = '/var/lib/cinder' - conf['keystone_authtoken']['auth_plugin'] = 'v2password' + conf['keystone_authtoken']['auth_type'] = 'v2password' conf['keystone_authtoken']['region_name'] = node['openstack']['region'] conf['keystone_authtoken']['username'] = 'cinder' conf['keystone_authtoken']['tenant_name'] = 'service' diff --git a/spec/api_spec.rb b/spec/api_spec.rb index d04f2d0..ba03c7c 100644 --- a/spec/api_spec.rb +++ b/spec/api_spec.rb @@ -12,8 +12,7 @@ describe 'openstack-block-storage::api' do include_context 'block-storage-stubs' include_examples 'common-logging' - - expect_creates_cinder_conf 'service[cinder-api]', 'cinder', 'cinder' + include_examples 'creates_cinder_conf', 'service[cinder-api]', 'cinder', 'cinder' it 'upgrades cinder api packages' do expect(chef_run).to upgrade_package('cinder-api') diff --git a/spec/scheduler_spec.rb b/spec/scheduler_spec.rb index 000c942..3b60a7c 100644 --- a/spec/scheduler_spec.rb +++ b/spec/scheduler_spec.rb @@ -12,8 +12,7 @@ describe 'openstack-block-storage::scheduler' do include_context 'block-storage-stubs' include_examples 'common-logging' - - expect_creates_cinder_conf 'service[cinder-scheduler]', 'cinder', 'cinder' + include_examples 'creates_cinder_conf', 'service[cinder-scheduler]', 'cinder', 'cinder' it 'upgrades cinder scheduler package' do expect(chef_run).to upgrade_package 'cinder-scheduler' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e22dae1..fb74603 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -90,7 +90,7 @@ def expect_runs_openstack_common_logging_recipe end end -def expect_creates_cinder_conf(service, user, group, action = :restart) +shared_examples 'creates_cinder_conf' do |service, user, group, action = :restart| describe 'cinder.conf' do let(:file) { chef_run.template('/etc/cinder/cinder.conf') } @@ -105,5 +105,28 @@ def expect_creates_cinder_conf(service, user, group, action = :restart) it 'notifies service restart' do expect(file).to notify(service).to(action) end + + it do + [ + /^auth_type = v2password$/, + /^region_name = RegionOne$/, + /^username = cinder/, + /^tenant_name = service$/, + %r{^signing_dir = /var/cache/cinder/api$}, + %r{^auth_url = http://127.0.0.1:5000/v2.0$}, + /^password = cinder-pass$/ + ].each do |line| + expect(chef_run).to render_config_file(file.name) + .with_section_content('keystone_authtoken', line) + end + end + + it 'has oslo_messaging_notifications conf values' do + [ + /^driver = cinder.openstack.common.notifier.rpc_notifier$/ + ].each do |line| + expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_notifications', line) + end + end end end diff --git a/spec/volume_spec.rb b/spec/volume_spec.rb index 25520d3..acf38eb 100644 --- a/spec/volume_spec.rb +++ b/spec/volume_spec.rb @@ -12,8 +12,7 @@ describe 'openstack-block-storage::volume' do include_context 'block-storage-stubs' include_examples 'common-logging' - - expect_creates_cinder_conf('service[cinder-volume]', 'cinder', 'cinder') + include_examples 'creates_cinder_conf', 'service[cinder-volume]', 'cinder', 'cinder' it 'upgrades cinder volume packages' do expect(chef_run).to upgrade_package 'cinder-volume'