From 1a8b6837926b3dc430dcdc782b361eb1e7934364 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Mon, 21 Dec 2015 20:27:45 +0100 Subject: [PATCH] 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 --- manifests/keystone/auth.pp | 2 +- spec/classes/neutron_keystone_auth_spec.rb | 27 ++++++++++------------ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index d7cd7bc5b..abf7655ff 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -189,7 +189,7 @@ class neutron::keystone::auth ( $real_service_name = pick($service_name, $auth_name) 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 { diff --git a/spec/classes/neutron_keystone_auth_spec.rb b/spec/classes/neutron_keystone_auth_spec.rb index 33c62edc9..7c15b8386 100644 --- a/spec/classes/neutron_keystone_auth_spec.rb +++ b/spec/classes/neutron_keystone_auth_spec.rb @@ -26,13 +26,12 @@ describe 'neutron::keystone::auth' do :roles => ['admin'] )} - it { is_expected.to contain_keystone_service('neutron').with( + it { is_expected.to contain_keystone_service('neutron::network').with( :ensure => 'present', - :type => 'network', :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', :public_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 - 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 describe 'with endpoint URL parameters' do @@ -72,7 +71,7 @@ describe 'neutron::keystone::auth' do } end - it { is_expected.to contain_keystone_endpoint('RegionOne/neutron').with( + it { is_expected.to contain_keystone_endpoint('RegionOne/neutron::network').with( :ensure => 'present', :public_url => 'https://10.10.10.10:80', :internal_url => 'https://10.10.10.11:81', @@ -95,7 +94,7 @@ describe 'neutron::keystone::auth' do } end - it { is_expected.to contain_keystone_endpoint('RegionOne/neutron').with( + it { is_expected.to contain_keystone_endpoint('RegionOne/neutron::network').with( :ensure => 'present', :public_url => "https://10.10.10.10:80", :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_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 @@ -133,8 +132,8 @@ describe 'neutron::keystone::auth' do it { is_expected.to contain_keystone_user('neutron') } 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_endpoint('RegionOne/neutron_service') } + it { is_expected.to contain_keystone_service('neutron_service::network') } + it { is_expected.to contain_keystone_endpoint('RegionOne/neutron_service::network') } 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_service('neutron').with( + it { is_expected.to contain_keystone_service('neutron::network').with( :ensure => 'present', - :type => 'network', :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.to contain_keystone_service('neutron').with( + it { is_expected.to contain_keystone_service('neutron::network').with( :ensure => 'present', - :type => 'network', :description => 'Neutron Networking Service' ) } @@ -190,7 +187,7 @@ describe 'neutron::keystone::auth' do } end - it { is_expected.to_not contain_keystone_endpoint('RegionOne/neutron') } + it { is_expected.to_not contain_keystone_endpoint('RegionOne/neutron::network') } end