Support identity_uri

This patch adds the ability to set a new identity_uri parameter.
It also deprecates the old auth_host, auth_port, auth_protocol,
and auth_admin_prefix parameters. Logic is in place so that
users of the deprecated settings should have a smooth upgrade
process and get deprecation warnings until they adopt the
new settings.

Change-Id: Id72991da18dd1f467a7683f8f450e157da64f969
Closes-Bug: #1391235
This commit is contained in:
Matt Fischer
2015-02-02 15:40:09 -07:00
parent 553d098745
commit 2dff962a65
4 changed files with 197 additions and 45 deletions

View File

@@ -28,7 +28,6 @@ describe 'glance::api' do
:auth_host => '127.0.0.1',
:auth_port => '35357',
:auth_protocol => 'http',
:auth_uri => 'http://127.0.0.1:5000/',
:keystone_tenant => 'services',
:keystone_user => 'glance',
:keystone_password => 'ChangeMe',
@@ -58,7 +57,6 @@ describe 'glance::api' do
:auth_host => '127.0.0.2',
:auth_port => '35358',
:auth_protocol => 'https',
:auth_uri => 'https://127.0.0.2:5000/v2.0/',
:keystone_tenant => 'admin2',
:keystone_user => 'admin2',
:keystone_password => 'ChangeMe2',
@@ -126,7 +124,7 @@ describe 'glance::api' do
should contain_glance_api_config('database/idle_timeout').with_value(param_hash[:database_idle_timeout])
end
it 'should have no ssl options' do
it 'should have no ssl options' do
should contain_glance_api_config('DEFAULT/ca_file').with_ensure('absent')
should contain_glance_api_config('DEFAULT/cert_file').with_ensure('absent')
should contain_glance_api_config('DEFAULT/key_file').with_ensure('absent')
@@ -379,6 +377,47 @@ describe 'glance::api' do
)}
end
describe 'with identity and auth settings' do
let :params do
{
:keystone_password => 'ChangeMe',
}
end
context 'with custom keystone identity_uri' do
let :params do
default_params.merge!({
:identity_uri => 'https://foo.bar:1234/',
})
end
it 'configures identity_uri' do
should contain_glance_api_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:1234/");
# since only identity_uri is set the deprecated auth parameters should
# still get set in case they are still in use
should contain_glance_api_config('keystone_authtoken/auth_host').with_value('127.0.0.1');
should contain_glance_api_config('keystone_authtoken/auth_port').with_value('35357');
should contain_glance_api_config('keystone_authtoken/auth_protocol').with_value('http');
end
end
context 'with custom keystone identity_uri and auth_uri' do
let :params do
default_params.merge!({
:identity_uri => 'https://foo.bar:35357/',
:auth_uri => 'https://foo.bar:5000/v2.0/',
})
end
it 'configures identity_uri' do
should contain_glance_api_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:35357/");
should contain_glance_api_config('keystone_authtoken/auth_uri').with_value("https://foo.bar:5000/v2.0/");
should contain_glance_api_config('keystone_authtoken/auth_host').with_ensure('absent')
should contain_glance_api_config('keystone_authtoken/auth_port').with_ensure('absent')
should contain_glance_api_config('keystone_authtoken/auth_protocol').with_ensure('absent')
should contain_glance_api_config('keystone_authtoken/auth_admin_prefix').with_ensure('absent')
end
end
end
describe 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }