Merge "Add related parameters to manila::quota"
This commit is contained in:
@@ -18,11 +18,36 @@
|
|||||||
# (optional) Default driver to use for quota checks.
|
# (optional) Default driver to use for quota checks.
|
||||||
# Defaults to 'manila.quota.DbQuotaDriver'.
|
# 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 (
|
class manila::quota (
|
||||||
$quota_shares = 10,
|
$quota_shares = 10,
|
||||||
$quota_snapshots = 10,
|
$quota_snapshots = 10,
|
||||||
$quota_gigabytes = 1000,
|
$quota_gigabytes = 1000,
|
||||||
$quota_driver = 'manila.quota.DbQuotaDriver'
|
$quota_driver = 'manila.quota.DbQuotaDriver',
|
||||||
|
$quota_snapshot_gigabytes = 1000,
|
||||||
|
$quota_share_networks = 10,
|
||||||
|
$reservation_expire = 86400,
|
||||||
|
$until_refresh = 0,
|
||||||
|
$max_age = 0,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
manila_config {
|
manila_config {
|
||||||
@@ -30,5 +55,10 @@ class manila::quota (
|
|||||||
'DEFAULT/quota_snapshots': value => $quota_snapshots;
|
'DEFAULT/quota_snapshots': value => $quota_snapshots;
|
||||||
'DEFAULT/quota_gigabytes': value => $quota_gigabytes;
|
'DEFAULT/quota_gigabytes': value => $quota_gigabytes;
|
||||||
'DEFAULT/quota_driver': value => $quota_driver;
|
'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)
|
:value => 1000)
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
|
is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
|
||||||
:value => 'manila.quota.DbQuotaDriver')
|
: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
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -19,7 +29,12 @@ describe 'manila::quota' do
|
|||||||
let :params do
|
let :params do
|
||||||
{ :quota_shares => 1000,
|
{ :quota_shares => 1000,
|
||||||
:quota_snapshots => 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
|
end
|
||||||
it 'contains overrided values' do
|
it 'contains overrided values' do
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_shares').with(
|
is_expected.to contain_manila_config('DEFAULT/quota_shares').with(
|
||||||
@@ -30,6 +45,16 @@ describe 'manila::quota' do
|
|||||||
:value => 100000)
|
:value => 100000)
|
||||||
is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
|
is_expected.to contain_manila_config('DEFAULT/quota_driver').with(
|
||||||
:value => 'manila.quota.DbQuotaDriver')
|
: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
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user