From ee0549f15dd6b9442b559ca363b934b60588b7e2 Mon Sep 17 00:00:00 2001 From: Risto Laurikainen Date: Wed, 18 Feb 2015 14:14:17 +0000 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 glance::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. Also, the test for when $configure_endpoint is false was set to check for an endpoint that doesn't get created even if $configure_endpoint is true. Fixed so that it checks for an endpoint that has the correct name (the same as when using the default values to call the class). Change-Id: I6631a656a888d0df7ab173705bea0598bd2b2f58 Closes-Bug: 1368686 --- manifests/keystone/auth.pp | 4 +++- spec/classes/glance_keystone_auth_spec.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index c9740095..9544b196 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -83,7 +83,9 @@ class glance::keystone::auth( $real_service_name = $service_name } - Keystone_endpoint["${region}/${real_service_name}"] ~> Service <| name == 'glance-api' |> + if $configure_endpoint { + Keystone_endpoint["${region}/${real_service_name}"] ~> Service <| name == 'glance-api' |> + } keystone::resource::service_identity { $auth_name: configure_user => $configure_user, diff --git a/spec/classes/glance_keystone_auth_spec.rb b/spec/classes/glance_keystone_auth_spec.rb index f102667a..8e0293a8 100644 --- a/spec/classes/glance_keystone_auth_spec.rb +++ b/spec/classes/glance_keystone_auth_spec.rb @@ -95,7 +95,7 @@ describe 'glance::keystone::auth' do } end - it { is_expected.to_not contain_keystone_endpoint('glance') } + it { is_expected.to_not contain_keystone_endpoint('RegionOne/glance') } end describe 'when disabling user configuration' do