Add cinder::backup::swift::swift_catalog_info parameter

... so that operators can define information to lookup swift service
in the service catalog.

Change-Id: Icd6336d4c10396b8eac7191571c2c12a2516c99f
This commit is contained in:
Takashi Kajinami
2020-04-21 16:50:06 +09:00
parent 29e221fe55
commit edbde19f88
3 changed files with 15 additions and 0 deletions

View File

@@ -17,6 +17,10 @@
# (optional) The URL of the Keystone endpoint for authentication.
# Defaults to $::os_service_default
#
# [*swift_catalog_info*]
# (optional) Info to match when looking for swift in the service catalog
# Defaults to $::os_service_default
#
# [*backup_swift_container*]
# (optional) The default Swift container to use.
# Defaults to 'volumebackups'
@@ -78,6 +82,7 @@ class cinder::backup::swift (
$backup_driver = 'cinder.backup.drivers.swift.SwiftBackupDriver',
$backup_swift_url = $::os_service_default,
$backup_swift_auth_url = $::os_service_default,
$swift_catalog_info = $::os_service_default,
$backup_swift_container = 'volumebackups',
$backup_swift_object_size = $::os_service_default,
$backup_swift_retry_attempts = $::os_service_default,
@@ -94,6 +99,7 @@ class cinder::backup::swift (
'DEFAULT/backup_driver': value => $backup_driver;
'DEFAULT/backup_swift_url': value => $backup_swift_url;
'DEFAULT/backup_swift_auth_url': value => $backup_swift_auth_url;
'DEFAULT/swift_catalog_info': value => $swift_catalog_info;
'DEFAULT/backup_swift_container': value => $backup_swift_container;
'DEFAULT/backup_swift_object_size': value => $backup_swift_object_size;
'DEFAULT/backup_swift_retry_attempts': value => $backup_swift_retry_attempts;

View File

@@ -0,0 +1,5 @@
---
features:
- |
The new ``cinder::backup::swift::swift_catalog_info`` parameter was added
to set info to lookup swift service in the service catalog.

View File

@@ -25,6 +25,7 @@ describe 'cinder::backup::swift' do
{
:backup_swift_url => '<SERVICE DEFAULT>',
:backup_swift_auth_url => '<SERVICE DEFAULT>',
:swift_catalog_info => '<SERVICE DEFAULT>',
:backup_swift_container => 'volumebackups',
:backup_swift_object_size => '<SERVICE DEFAULT>',
:backup_swift_retry_attempts => '<SERVICE DEFAULT>',
@@ -49,6 +50,7 @@ describe 'cinder::backup::swift' do
is_expected.to contain_cinder_config('DEFAULT/backup_driver').with_value('cinder.backup.drivers.swift.SwiftBackupDriver')
is_expected.to contain_cinder_config('DEFAULT/backup_swift_url').with_value(p[:backup_swift_url])
is_expected.to contain_cinder_config('DEFAULT/backup_swift_auth_url').with_value(p[:backup_swift_auth_url])
is_expected.to contain_cinder_config('DEFAULT/swift_catalog_info').with_value(p[:swift_catalog_info])
is_expected.to contain_cinder_config('DEFAULT/backup_swift_container').with_value(p[:backup_swift_container])
is_expected.to contain_cinder_config('DEFAULT/backup_swift_object_size').with_value(p[:backup_swift_object_size])
is_expected.to contain_cinder_config('DEFAULT/backup_swift_retry_attempts').with_value(p[:backup_swift_retry_attempts])
@@ -63,6 +65,7 @@ describe 'cinder::backup::swift' do
before :each do
params.merge!(:backup_swift_url => 'https://controller2:8080/v1/AUTH_')
params.merge!(:backup_swift_auth_url => 'https://controller2:5000')
params.merge!(:swift_catalog_info => 'object-store:swift:internalURL')
params.merge!(:backup_swift_container => 'toto')
params.merge!(:backup_swift_object_size => '123')
params.merge!(:backup_swift_retry_attempts => '99')
@@ -72,6 +75,7 @@ describe 'cinder::backup::swift' do
it 'should replace default parameters with new values' do
is_expected.to contain_cinder_config('DEFAULT/backup_swift_url').with_value(p[:backup_swift_url])
is_expected.to contain_cinder_config('DEFAULT/backup_swift_auth_url').with_value(p[:backup_swift_auth_url])
is_expected.to contain_cinder_config('DEFAULT/swift_catalog_info').with_value(p[:swift_catalog_info])
is_expected.to contain_cinder_config('DEFAULT/backup_swift_container').with_value(p[:backup_swift_container])
is_expected.to contain_cinder_config('DEFAULT/backup_swift_object_size').with_value(p[:backup_swift_object_size])
is_expected.to contain_cinder_config('DEFAULT/backup_swift_retry_attempts').with_value(p[:backup_swift_retry_attempts])