Make Keystone_endpoint match service by name/type

Since a chance in puppet-keystone (1], we now match an endpoint with a
service name/type.
)
[1] http://git.openstack.org/cgit/openstack/puppet-keystone/commit/?id=0a4e06abb0f5b3f324464ff5219d2885816311ce

Change-Id: I385880c12a2a0e0632ae6d42d570b3b8bad536eb
Closes-Bug: #1528308
This commit is contained in:
Emilien Macchi 2015-12-21 20:27:45 +01:00
parent 4eeba83541
commit 1a8b683792
2 changed files with 13 additions and 16 deletions

View File

@ -189,7 +189,7 @@ class neutron::keystone::auth (
$real_service_name = pick($service_name, $auth_name) $real_service_name = pick($service_name, $auth_name)
if $configure_endpoint { if $configure_endpoint {
Keystone_endpoint["${region}/${real_service_name}"] ~> Service <| title == 'neutron-server' |> Keystone_endpoint["${region}/${real_service_name}::${service_type}"] ~> Service <| title == 'neutron-server' |>
} }
if $configure_user_role { if $configure_user_role {

View File

@ -26,13 +26,12 @@ describe 'neutron::keystone::auth' do
:roles => ['admin'] :roles => ['admin']
)} )}
it { is_expected.to contain_keystone_service('neutron').with( it { is_expected.to contain_keystone_service('neutron::network').with(
:ensure => 'present', :ensure => 'present',
:type => 'network',
:description => 'Neutron Networking Service' :description => 'Neutron Networking Service'
) } ) }
it { is_expected.to contain_keystone_endpoint('RegionOne/neutron').with( it { is_expected.to contain_keystone_endpoint('RegionOne/neutron::network').with(
:ensure => 'present', :ensure => 'present',
:public_url => "http://127.0.0.1:9696", :public_url => "http://127.0.0.1:9696",
:admin_url => "http://127.0.0.1:9696", :admin_url => "http://127.0.0.1:9696",
@ -59,7 +58,7 @@ describe 'neutron::keystone::auth' do
} }
end end
it { is_expected.to contain_keystone_endpoint('RegionOne/neutron').with_notify(['Service[neutron-server]']) } it { is_expected.to contain_keystone_endpoint('RegionOne/neutron::network').with_notify(['Service[neutron-server]']) }
end end
describe 'with endpoint URL parameters' do describe 'with endpoint URL parameters' do
@ -72,7 +71,7 @@ describe 'neutron::keystone::auth' do
} }
end end
it { is_expected.to contain_keystone_endpoint('RegionOne/neutron').with( it { is_expected.to contain_keystone_endpoint('RegionOne/neutron::network').with(
:ensure => 'present', :ensure => 'present',
:public_url => 'https://10.10.10.10:80', :public_url => 'https://10.10.10.10:80',
:internal_url => 'https://10.10.10.11:81', :internal_url => 'https://10.10.10.11:81',
@ -95,7 +94,7 @@ describe 'neutron::keystone::auth' do
} }
end end
it { is_expected.to contain_keystone_endpoint('RegionOne/neutron').with( it { is_expected.to contain_keystone_endpoint('RegionOne/neutron::network').with(
:ensure => 'present', :ensure => 'present',
:public_url => "https://10.10.10.10:80", :public_url => "https://10.10.10.10:80",
:internal_url => "https://10.10.10.11:81", :internal_url => "https://10.10.10.11:81",
@ -116,9 +115,9 @@ describe 'neutron::keystone::auth' do
it { is_expected.to contain_keystone_user_role('neutrony@services') } it { is_expected.to contain_keystone_user_role('neutrony@services') }
it { is_expected.to contain_keystone_service('neutrony') } it { is_expected.to contain_keystone_service('neutrony::network') }
it { is_expected.to contain_keystone_endpoint('RegionOne/neutrony') } it { is_expected.to contain_keystone_endpoint('RegionOne/neutrony::network') }
end end
@ -133,8 +132,8 @@ describe 'neutron::keystone::auth' do
it { is_expected.to contain_keystone_user('neutron') } it { is_expected.to contain_keystone_user('neutron') }
it { is_expected.to contain_keystone_user_role('neutron@services') } it { is_expected.to contain_keystone_user_role('neutron@services') }
it { is_expected.to contain_keystone_service('neutron_service') } it { is_expected.to contain_keystone_service('neutron_service::network') }
it { is_expected.to contain_keystone_endpoint('RegionOne/neutron_service') } it { is_expected.to contain_keystone_endpoint('RegionOne/neutron_service::network') }
end end
@ -151,9 +150,8 @@ describe 'neutron::keystone::auth' do
it { is_expected.to contain_keystone_user_role('neutron@services') } it { is_expected.to contain_keystone_user_role('neutron@services') }
it { is_expected.to contain_keystone_service('neutron').with( it { is_expected.to contain_keystone_service('neutron::network').with(
:ensure => 'present', :ensure => 'present',
:type => 'network',
:description => 'Neutron Networking Service' :description => 'Neutron Networking Service'
) } ) }
@ -173,9 +171,8 @@ describe 'neutron::keystone::auth' do
it { is_expected.not_to contain_keystone_user_role('neutron@services') } it { is_expected.not_to contain_keystone_user_role('neutron@services') }
it { is_expected.to contain_keystone_service('neutron').with( it { is_expected.to contain_keystone_service('neutron::network').with(
:ensure => 'present', :ensure => 'present',
:type => 'network',
:description => 'Neutron Networking Service' :description => 'Neutron Networking Service'
) } ) }
@ -190,7 +187,7 @@ describe 'neutron::keystone::auth' do
} }
end end
it { is_expected.to_not contain_keystone_endpoint('RegionOne/neutron') } it { is_expected.to_not contain_keystone_endpoint('RegionOne/neutron::network') }
end end