Merge "Add support for [storage] swift_container_prefix"

This commit is contained in:
Zuul 2024-09-02 20:18:31 +00:00 committed by Gerrit Code Review
commit 5f8778ff8b
3 changed files with 15 additions and 1 deletions

View File

@ -67,6 +67,10 @@
# (optional) Connection timeout in seconds.
# Defaults to $facts['os_service_default']
#
# [*swift_container_prefix*]
# (optional) Prefix to namespace metric containers.
# Defaults to $facts['os_service_default']
#
class gnocchi::storage::swift(
$swift_auth_version = $facts['os_service_default'],
$swift_authurl = $facts['os_service_default'],
@ -79,6 +83,7 @@ class gnocchi::storage::swift(
$swift_endpoint_type = $facts['os_service_default'],
$swift_service_type = $facts['os_service_default'],
$swift_timeout = $facts['os_service_default'],
$swift_container_prefix = $facts['os_service_default'],
) {
include gnocchi::deps
@ -96,6 +101,7 @@ class gnocchi::storage::swift(
'storage/swift_endpoint_type': value => $swift_endpoint_type;
'storage/swift_service_type': value => $swift_service_type;
'storage/swift_timeout': value => $swift_timeout;
'storage/swift_container_prefix': value => $swift_container_prefix;
}
}

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``gnocchi::storage::swift::swift_container_prefix`` prameter has
been added.

View File

@ -25,6 +25,7 @@ describe 'gnocchi::storage::swift' do
is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_service_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('storage/swift_container_prefix').with_value('<SERVICE DEFAULT>')
end
end
@ -41,7 +42,8 @@ describe 'gnocchi::storage::swift' do
:swift_auth_version => 2,
:swift_endpoint_type => 'publicURL',
:swift_service_type => 'object-store',
:swift_timeout => 0
:swift_timeout => 0,
:swift_container_prefix => 'gnocchi',
})
end
@ -58,6 +60,7 @@ describe 'gnocchi::storage::swift' do
is_expected.to contain_gnocchi_config('storage/swift_endpoint_type').with_value('publicURL')
is_expected.to contain_gnocchi_config('storage/swift_service_type').with_value('object-store')
is_expected.to contain_gnocchi_config('storage/swift_timeout').with_value(0)
is_expected.to contain_gnocchi_config('storage/swift_container_prefix').with_value('gnocchi')
end
end
end