Merge "Support [os-brick] wait_mpath_device_* options"

This commit is contained in:
Zuul 2024-09-25 03:49:16 +00:00 committed by Gerrit Code Review
commit 892520295e
3 changed files with 30 additions and 3 deletions

View File

@ -8,12 +8,25 @@
# (Optional) Directory to use for os-brick lock files.
# Defaults to $facts['os_service_default']
#
# [*wait_mpath_device_attempts*]
# (Optional) Number of attempts for the multipath device to be ready for I/O
# after it was created.
# Defaults to $facts['os_service_default']
#
# [*wait_mpath_device_interval*]
# (Optional) Interval value to wait for multipath device to be ready for I/O.
# Defaults to $facts['os_service_default']
#
define oslo::os_brick(
$lock_path = $facts['os_service_default'],
$lock_path = $facts['os_service_default'],
$wait_mpath_device_attempts = $facts['os_service_default'],
$wait_mpath_device_interval = $facts['os_service_default'],
) {
$os_brick_options = {
'os_brick/lock_path' => { value => $lock_path },
'os_brick/lock_path' => { value => $lock_path },
'os_brick/wait_mpath_device_attempts' => { value => $wait_mpath_device_attempts },
'os_brick/wait_mpath_device_interval' => { value => $wait_mpath_device_interval },
}
create_resources($name, $os_brick_options)
}

View File

@ -0,0 +1,8 @@
---
features:
- |
The following parameters have been added to the ``oslo::os_brick`` defined
resource type.
- ``wait_mpath_device_attempts``
- ``wait_mpath_device_interval``

View File

@ -9,18 +9,24 @@ describe 'oslo::os_brick' do
context 'with defaults' do
it 'configures the default values' do
is_expected.to contain_keystone_config('os_brick/lock_path').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('os_brick/wait_mpath_device_attempts').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('os_brick/wait_mpath_device_interval').with_value('<SERVICE DEFAULT>')
end
end
context 'with parameters overridden' do
let :params do
{
:lock_path => '/var/lib/openstack/lock'
:lock_path => '/var/lib/openstack/lock',
:wait_mpath_device_attempts => 4,
:wait_mpath_device_interval => 1,
}
end
it 'configures the overridden values' do
is_expected.to contain_keystone_config('os_brick/lock_path').with_value('/var/lib/openstack/lock')
is_expected.to contain_keystone_config('os_brick/wait_mpath_device_attempts').with_value(4)
is_expected.to contain_keystone_config('os_brick/wait_mpath_device_interval').with_value(1)
end
end
end