Accept an array for service_token_roles

... because the parameter is defined as a ListOpt which represents
a list value.

Change-Id: I852f242f83c6409e15abbf5e46eaefad1d14b0b8
This commit is contained in:
Takashi Kajinami
2021-11-01 19:57:10 +09:00
parent da2ed9d5bb
commit e88af3efa8
2 changed files with 10 additions and 1 deletions

View File

@@ -331,7 +331,7 @@ define keystone::resource::authtoken(
'keystone_authtoken/project_name' => {'value' => $project_name},
'keystone_authtoken/project_domain_name' => {'value' => $project_domain_name},
'keystone_authtoken/insecure' => {'value' => $insecure},
'keystone_authtoken/service_token_roles' => {'value' => $service_token_roles},
'keystone_authtoken/service_token_roles' => {'value' => join(any2array($service_token_roles), ',')},
'keystone_authtoken/service_token_roles_required' => {'value' => $service_token_roles_required},
'keystone_authtoken/service_type' => {'value' => $service_type},
'keystone_authtoken/interface' => {'value' => $interface},

View File

@@ -199,6 +199,15 @@ describe 'keystone::resource::authtoken' do
it { expect { is_expected.to raise_error(Puppet::Error, 'memcache_secret_key is required when memcache_security_strategy is defined') } }
end
context 'when service_token_roles is an array' do
before do
params.merge!({
:service_token_roles => ['service', 'alt_service']
})
it { is_expected.to contain_keystone_config('service_token_roles').with_value('service,alt_service') }
end
end
end
on_supported_os({