Add backup_swift_auth_url to cinder::backup::swift

The parameter backup_swift_auth_url was added to the swift backup
driver to differentiate the auth url from the actualy swift url.
This patch adds that new config option to cinder::backup::swift.

Change-Id: I3dc0d0a161f1b35402ad2884d38c38a99fb1e23e
Closes-bug: #1518343
This commit is contained in:
Nate Potter 2015-11-20 15:36:38 +00:00
parent 181de2ef51
commit 88ec8e4603
2 changed files with 10 additions and 0 deletions
manifests/backup
spec/classes

@ -13,6 +13,10 @@
# Should be a valid Swift URL
# Defaults to 'http://localhost:8080/v1/AUTH_'
#
# [*backup_swift_auth_url*]
# (optional) The URL of the Keystone endpoint for authentication.
# Defaults to 'http://127.0.0.1:5000/v2.0/'
#
# [*backup_swift_container*]
# (optional) The default Swift container to use.
# Defaults to 'volumes_backup'
@ -58,6 +62,7 @@
class cinder::backup::swift (
$backup_driver = 'cinder.backup.drivers.swift',
$backup_swift_url = 'http://localhost:8080/v1/AUTH_',
$backup_swift_auth_url = 'http://127.0.0.1:5000/v2.0/',
$backup_swift_container = 'volumes_backup',
$backup_swift_object_size = $::os_service_default,
$backup_swift_retry_attempts = $::os_service_default,
@ -72,6 +77,7 @@ class cinder::backup::swift (
cinder_config {
'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/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;

@ -24,6 +24,7 @@ describe 'cinder::backup::swift' do
let :default_params do
{ :backup_swift_url => 'http://localhost:8080/v1/AUTH_',
:backup_swift_auth_url => 'http://127.0.0.1:5000/v2.0/',
:backup_swift_container => 'volumes_backup',
:backup_swift_object_size => '<SERVICE DEFAULT>',
:backup_swift_retry_attempts => '<SERVICE DEFAULT>',
@ -43,6 +44,7 @@ describe 'cinder::backup::swift' do
it 'configures cinder.conf' do
is_expected.to contain_cinder_config('DEFAULT/backup_driver').with_value('cinder.backup.drivers.swift')
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/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])
@ -53,6 +55,7 @@ describe 'cinder::backup::swift' do
context 'when overriding default parameters' do
before :each do
params.merge!(:backup_swift_url => 'https://controller2:8080/v1/AUTH_')
params.merge!(:backup_swift_auth_url => 'https://controller2:35357')
params.merge!(:backup_swift_container => 'toto')
params.merge!(:backup_swift_object_size => '123')
params.merge!(:backup_swift_retry_attempts => '99')
@ -61,6 +64,7 @@ describe 'cinder::backup::swift' do
end
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/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])