Merge "quota: Stop overriding defaults"

This commit is contained in:
Zuul 2024-02-05 22:18:56 +00:00 committed by Gerrit Code Review
commit 1ceca6c229
3 changed files with 28 additions and 32 deletions

View File

@ -6,15 +6,15 @@
#
# [*max_instances_per_tenant*]
# (optional) Default maximum number of instances per tenant.
# Defaults to 5.
# Defaults to $facts['os_service_default'].
#
# [*max_ram_per_tenant*]
# (optional) Default maximum amount of RAM (in MB) per tenant.
# Defaults to -1.
# Defaults to $facts['os_service_default'].
#
# [*max_accepted_volume_size*]
# (optional) Default maximum volume size (in GB) for an instance.
# Defaults to 5.
# Defaults to $facts['os_service_default'].
#
# [*max_volumes_per_tenant*]
# (optional) Default maximum volume capacity (in GB) spanning across
@ -23,19 +23,19 @@
#
# [*max_backups_per_tenant*]
# (optional) Default maximum number of backups created by a tenant.
# Defaults to 50.
# Defaults to $facts['os_service_default'].
#
# [*quota_driver*]
# (optional) Default driver to use for quota checks.
# Defaults to 'trove.quota.quota.DbQuotaDriver'.
#
class trove::quota (
$max_instances_per_tenant = 5,
$max_ram_per_tenant = -1,
$max_accepted_volume_size = 5,
$max_volumes_per_tenant = 20,
$max_backups_per_tenant = 50,
$quota_driver = 'trove.quota.quota.DbQuotaDriver',
$max_instances_per_tenant = $facts['os_service_default'],
$max_ram_per_tenant = $facts['os_service_default'],
$max_accepted_volume_size = $facts['os_service_default'],
$max_volumes_per_tenant = $facts['os_service_default'],
$max_backups_per_tenant = $facts['os_service_default'],
$quota_driver = $facts['os_service_default'],
) {
include trove::deps

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Default values of the ``trove::quota`` class parameters have been updated
and now the service default values are used by default.

View File

@ -5,18 +5,12 @@ describe 'trove::quota' do
shared_examples_for 'trove::quota' do
context 'with default parameters' do
it 'contains default values' do
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with(
:value => 5)
is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with(
:value => -1)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
:value => 5)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with(
:value => 20)
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with(
:value => 50)
is_expected.to contain_trove_config('DEFAULT/quota_driver').with(
:value => 'trove.quota.quota.DbQuotaDriver')
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/quota_driver').with_value('<SERVICE DEFAULT>')
end
end
@ -27,19 +21,16 @@ describe 'trove::quota' do
:max_accepted_volume_size => 10,
:max_volumes_per_tenant => 100,
:max_backups_per_tenant => 100,
:quota_driver => 'trove.quota.quota.DbQuotaDriver',
}
end
it 'contains overrided values' do
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with(
:value => 100)
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with(
:value => 100)
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with_value(10)
is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with_value(10)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with_value(10)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with_value(100)
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with_value(100)
is_expected.to contain_trove_config('DEFAULT/quota_driver').with_value('trove.quota.quota.DbQuotaDriver')
end
end
end