Merge "Added the allow_versions flag to enable/disable object versioning in swift object container"

This commit is contained in:
Jenkins 2013-07-22 15:59:07 +00:00 committed by Gerrit Code Review
commit 503d3e41c0
3 changed files with 10 additions and 0 deletions

@ -14,6 +14,7 @@ define swift::storage::server(
$mount_check = false,
$user = 'swift',
$workers = '1',
$allow_versions = false,
$replicator_concurrency = $::processorcount,
$updater_concurrency = $::processorcount,
$reaper_concurrency = $::processorcount,
@ -38,6 +39,7 @@ define swift::storage::server(
validate_re($name, '^\d+$')
validate_re($type, '^object|container|account$')
validate_array($pipeline)
validate_bool($allow_versions)
# TODO - validate that name is an integer
$bind_port = $name

@ -91,6 +91,7 @@ describe 'swift::storage::server' do
expect { subject }.to raise_error(Puppet::Error, /is not an Array/)
end
end
describe "when replicator_concurrency is set" do
let :params do req_params.merge({:replicator_concurrency => 42}) end
it { should contain_file(fragment_file) \
@ -112,6 +113,12 @@ describe 'swift::storage::server' do
}
end
end
if t == 'container'
describe "when allow_versioning is set" do
let :params do req_params.merge({ :allow_versions => false, }) end
it { should contain_file(fragment_file).with_content(/\[app:container-server\]\nallow_versions\s*=\s*false\s*$/m)}
end
end
end
describe 'with all allowed defaults' do

@ -12,6 +12,7 @@ allowed_sync_hosts = <%= scope.lookupvar("swift::storage::container::allowed_syn
pipeline = <%= @pipeline.to_a.join(' ') %>
[app:container-server]
allow_versions = <%= allow_versions %>
use = egg:swift#container
set log_name = container-server
set log_facility = <%= log_facility %>