Browse Source

Allow list values for enabled_extensions_admin/v2

The following parameters are defined as "ListOpt"s which accept
comma-separated lists.
 service:api/enabled_extensions_admin
 service:api/enabled_extensions_v2

This change makes sure that list values are converted to string
properly to accept list values in the corresponding designate::api
parameters.

Change-Id: I6c18016bf33791e953f708b0f6abf772a434d74f
changes/07/800507/3
Takashi Kajinami 2 months ago
parent
commit
2950b5d77a
  1. 4
      manifests/api.pp
  2. 18
      spec/classes/designate_api_spec.rb

4
manifests/api.pp

@ -146,8 +146,8 @@ class designate::api (
'service:api/default_limit_v2' : value => $default_limit_v2;
'service:api/max_limit_v2' : value => $max_limit_v2;
'service:api/pecan_debug' : value => $pecan_debug;
'service:api/enabled_extensions_v2' : value => $enabled_extensions_v2;
'service:api/enabled_extensions_admin' : value => $enabled_extensions_admin;
'service:api/enabled_extensions_v2' : value => join(any2array($enabled_extensions_v2), ',');
'service:api/enabled_extensions_admin' : value => join(any2array($enabled_extensions_admin), ',');
}
if $auth_strategy == 'keystone' {

18
spec/classes/designate_api_spec.rb

@ -72,8 +72,8 @@ describe 'designate::api' do
:default_limit_v2 => '25',
:max_limit_v2 => '1500',
:pecan_debug => true,
:enabled_extensions_v2 => 'experimental',
:enabled_extensions_admin => 'reports,quotas,counts,tenants,target_sync',
:enabled_extensions_v2 => 'ext1,ext2',
:enabled_extensions_admin => 'reports,quotas,zones',
:enable_proxy_headers_parsing => true,
})
end
@ -101,6 +101,20 @@ describe 'designate::api' do
end
end
context 'with enabled_extentions in list' do
before do
params.merge!({
:enabled_extensions_v2 => ['ext1', 'ext2'],
:enabled_extensions_admin => ['reports', 'quotas', 'zones']
})
end
it 'configure service_api' do
is_expected.to contain_designate_config('service:api/enabled_extensions_v2').with_value('ext1,ext2')
is_expected.to contain_designate_config('service:api/enabled_extensions_admin').with_value('reports,quotas,zones')
end
end
context 'with custom package name' do
before do
params.merge!({ :api_package_name => 'designate-api-custom-name' })

Loading…
Cancel
Save