From 39867dcd31cacf6882ede22fb25d9cd62aaf1a40 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 10 Jun 2015 15:24:07 -0400 Subject: [PATCH] Fix catalog compilation when not configuring endpoint Previously when you set $configure_endpoint to false and did not have a keystone_endpoint resource with the same name as is defined by neutron::keystone::auth, the catalog would not be compiled. This was because a relationship was being established where one resource in the relationship didn't exist. This changes this so that the relationship involving the Keystone endpoint is only defined if $configure_endpoint is set to true. Change-Id: I1ee51f33ffd1bf20578cd56120ee5be8e6fa0133 Co-Authored-By: Risto Laurikainen Co-Authored-By: Gael Chamoulaud Closes-Bug: 1368686 --- manifests/keystone/auth.pp | 6 ++++-- spec/classes/trove_keystone_auth_spec.rb | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index b39761ca..b76309ac 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -195,8 +195,10 @@ class trove::keystone::auth ( $real_service_name = pick($service_name, $auth_name) - Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'trove-server' |> - Keystone_endpoint["${region}/${real_service_name}"] ~> Service <| name == 'trove-server' |> + Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'trove-server' |> + + Keystone_endpoint<| title == "${region}/${real_service_name}" |> + ~> Service <| name == 'trove-server' |> keystone::resource::service_identity { 'trove': configure_user => true, diff --git a/spec/classes/trove_keystone_auth_spec.rb b/spec/classes/trove_keystone_auth_spec.rb index 63204e9d..dde648f4 100644 --- a/spec/classes/trove_keystone_auth_spec.rb +++ b/spec/classes/trove_keystone_auth_spec.rb @@ -130,4 +130,12 @@ describe 'trove::keystone::auth' do it { is_expected.to contain_keystone_endpoint('RegionOne/trove_service') } end + describe 'when disabling endpoint configuration' do + let :params do + { :configure_endpoint => false, + :password => 'trove_password' } + end + + it { is_expected.to_not contain_keystone_endpoint('RegionOne/neutron') } + end end