Merge "Add default_volume_type as cinder api parameter"

This commit is contained in:
Jenkins 2014-02-19 16:45:31 +00:00 committed by Gerrit Code Review
commit b88fd97dc3
2 changed files with 26 additions and 1 deletions

View File

@ -62,6 +62,10 @@
# (optional) Factory to use for ratelimiting
# Defaults to 'cinder.api.v1.limits:RateLimitingMiddleware.factory'
#
# [*default_volume_type*]
# (optional) Specify the default volume type
# Defaults to undef.
#
class cinder::api (
$keystone_password,
$keystone_enabled = true,
@ -78,7 +82,8 @@ class cinder::api (
$enabled = true,
$ratelimits = undef,
$ratelimits_factory =
'cinder.api.v1.limits:RateLimitingMiddleware.factory'
'cinder.api.v1.limits:RateLimitingMiddleware.factory',
$default_volume_type = undef,
) {
include cinder::params
@ -165,4 +170,13 @@ class cinder::api (
}
}
}
if $default_volume_type {
cinder_config {
'DEFAULT/default_volume_type': value => $default_volume_type;
}
} else {
cinder_config {
'DEFAULT/default_volume_type': ensure => absent;
}
}
}

View File

@ -83,6 +83,7 @@ describe 'cinder::api' do
should contain_cinder_config('DEFAULT/osapi_volume_listen').with(
:value => '192.168.1.3'
)
should contain_cinder_config('DEFAULT/default_volume_type').with_ensure('absent')
end
end
@ -141,4 +142,14 @@ describe 'cinder::api' do
)}
end
describe 'with default volume type' do
let :params do
req_params.merge({ :default_volume_type => 'LVM_iSCSI' })
end
it { should contain_cinder_config('DEFAULT/default_volume_type').with(
:value => 'LVM_iSCSI'
)}
end
end