Add related parameters to manila::quota
This patch is aim to following params in manila::quota: - quota_snapshot_gigabytes - quota_share_networks - reservation_expire - until_refresh - max_age Change-Id: Ic28c6115a7c07554c6d333e491a2f1dd252c9520 Closes-Bug: #1469583
This commit is contained in:
parent
57a143baf6
commit
17c4e995e5
@ -18,17 +18,47 @@
|
||||
# (optional) Default driver to use for quota checks.
|
||||
# Defaults to 'manila.quota.DbQuotaDriver'.
|
||||
#
|
||||
# [*quota_snapshot_gigabytes*]
|
||||
# (optional) Number of snapshot gigabytes allowed per project.
|
||||
# Defaults to 1000.
|
||||
#
|
||||
# [*quota_share_networks*]
|
||||
# (optional) Number of share-networks allowed per project.
|
||||
# Defaults to 10.
|
||||
#
|
||||
# [*reservation_expire*]
|
||||
# (optional) Number of seconds until a reservation expires.
|
||||
# Defaults to 86400.
|
||||
#
|
||||
# [*until_refresh*]
|
||||
# (optional) Count of reservations until usage is refreshed.
|
||||
# Defaults to 0.
|
||||
#
|
||||
# [*max_age*]
|
||||
# (optional) Number of seconds between subsequent usage refreshes.
|
||||
# Defaults to 0.
|
||||
#
|
||||
class manila::quota (
|
||||
$quota_shares = 10,
|
||||
$quota_snapshots = 10,
|
||||
$quota_gigabytes = 1000,
|
||||
$quota_driver = 'manila.quota.DbQuotaDriver'
|
||||
$quota_shares = 10,
|
||||
$quota_snapshots = 10,
|
||||
$quota_gigabytes = 1000,
|
||||
$quota_driver = 'manila.quota.DbQuotaDriver',
|
||||
$quota_snapshot_gigabytes = 1000,
|
||||
$quota_share_networks = 10,
|
||||
$reservation_expire = 86400,
|
||||
$until_refresh = 0,
|
||||
$max_age = 0,
|
||||
) {
|
||||
|
||||
manila_config {
|
||||
'DEFAULT/quota_shares': value => $quota_shares;
|
||||
'DEFAULT/quota_snapshots': value => $quota_snapshots;
|
||||
'DEFAULT/quota_gigabytes': value => $quota_gigabytes;
|
||||
'DEFAULT/quota_driver': value => $quota_driver;
|
||||
'DEFAULT/quota_shares': value => $quota_shares;
|
||||
'DEFAULT/quota_snapshots': value => $quota_snapshots;
|
||||
'DEFAULT/quota_gigabytes': value => $quota_gigabytes;
|
||||
'DEFAULT/quota_driver': value => $quota_driver;
|
||||
'DEFAULT/quota_snapshot_gigabytes': value => $quota_snapshot_gigabytes;
|
||||
'DEFAULT/quota_share_networks': value => $quota_share_networks;
|
||||
'DEFAULT/reservation_expire': value => $reservation_expire;
|
||||
'DEFAULT/until_refresh': value => $until_refresh;
|
||||
'DEFAULT/max_age': value => $max_age;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,16 @@ describe 'manila::quota' do
|
||||
:value => 1000)
|
||||
is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
|
||||
:value => 'manila.quota.DbQuotaDriver')
|
||||
is_expected.to contain_manila_config('DEFAULT/quota_snapshot_gigabytes').with(
|
||||
:value => 1000)
|
||||
is_expected.to contain_manila_config('DEFAULT/quota_share_networks').with(
|
||||
:value => 10)
|
||||
is_expected.to contain_manila_config('DEFAULT/reservation_expire').with(
|
||||
:value => 86400)
|
||||
is_expected.to contain_manila_config('DEFAULT/until_refresh').with(
|
||||
:value => 0)
|
||||
is_expected.to contain_manila_config('DEFAULT/max_age').with(
|
||||
:value => 0)
|
||||
end
|
||||
end
|
||||
|
||||
@ -19,7 +29,12 @@ describe 'manila::quota' do
|
||||
let :params do
|
||||
{ :quota_shares => 1000,
|
||||
:quota_snapshots => 1000,
|
||||
:quota_gigabytes => 100000 }
|
||||
:quota_gigabytes => 100000,
|
||||
:quota_snapshot_gigabytes => 10000,
|
||||
:quota_share_networks => 100,
|
||||
:reservation_expire => 864000,
|
||||
:until_refresh => 10,
|
||||
:max_age => 10,}
|
||||
end
|
||||
it 'contains overrided values' do
|
||||
is_expected.to contain_manila_config('DEFAULT/quota_shares').with(
|
||||
@ -30,6 +45,16 @@ describe 'manila::quota' do
|
||||
:value => 100000)
|
||||
is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
|
||||
:value => 'manila.quota.DbQuotaDriver')
|
||||
is_expected.to contain_manila_config('DEFAULT/quota_snapshot_gigabytes').with(
|
||||
:value => 10000)
|
||||
is_expected.to contain_manila_config('DEFAULT/quota_share_networks').with(
|
||||
:value => 100)
|
||||
is_expected.to contain_manila_config('DEFAULT/reservation_expire').with(
|
||||
:value => 864000)
|
||||
is_expected.to contain_manila_config('DEFAULT/until_refresh').with(
|
||||
:value => 10)
|
||||
is_expected.to contain_manila_config('DEFAULT/max_age').with(
|
||||
:value => 10)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user