dispersion: add endpoint_type parameter

This parameter is needed to perform a clean object dispersion.

Change-Id: I1c17f49b22fd2b30c022d27a2bc20ce0bd150240
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi 2014-01-27 22:20:45 +01:00
parent a5b5e1211f
commit 6aa573e49a
2 changed files with 39 additions and 30 deletions

View File

@ -27,6 +27,9 @@
# String. The version to pass to the 'swift' command.
# Use '2.0' when using Keystone.
# Optional. Defaults to '2.0'
# [*endpoint_type*]
# String. The ability to choose which Swift endpoint to use.
# Optional. Defaults to 'publicURL'.
# [*swift_dir*]
# String. The path to swift configuration folder
# Optional. Defaults to '/etc/swift'.
@ -55,16 +58,17 @@
#
class swift::dispersion (
$auth_url = 'http://127.0.0.1:5000/v2.0/',
$auth_user = 'dispersion',
$auth_tenant = 'services',
$auth_pass = 'dispersion_password',
$auth_version = '2.0',
$swift_dir = '/etc/swift',
$coverage = 1,
$retries = 5,
$concurrency = 25,
$dump_json = 'no'
$auth_url = 'http://127.0.0.1:5000/v2.0/',
$auth_user = 'dispersion',
$auth_tenant = 'services',
$auth_pass = 'dispersion_password',
$auth_version = '2.0',
$endpoint_type = 'publicURL',
$swift_dir = '/etc/swift',
$coverage = 1,
$retries = 5,
$concurrency = 25,
$dump_json = 'no'
) {
include swift::params
@ -85,6 +89,7 @@ class swift::dispersion (
'dispersion/auth_user': value => "${auth_tenant}:${auth_user}";
'dispersion/auth_key': value => $auth_pass;
'dispersion/auth_version': value => $auth_version;
'dispersion/endpoint_type': value => $endpoint_type;
'dispersion/swift_dir': value => $swift_dir;
'dispersion/dispersion_coverage': value => $coverage;
'dispersion/retries': value => $retries;

View File

@ -3,16 +3,17 @@ require 'spec_helper'
describe 'swift::dispersion' do
let :default_params do
{ :auth_url => 'http://127.0.0.1:5000/v2.0/',
:auth_user => 'dispersion',
:auth_tenant => 'services',
:auth_pass => 'dispersion_password',
:auth_version => '2.0',
:swift_dir => '/etc/swift',
:coverage => 1,
:retries => 5,
:concurrency => 25,
:dump_json => 'no' }
{ :auth_url => 'http://127.0.0.1:5000/v2.0/',
:auth_user => 'dispersion',
:auth_tenant => 'services',
:auth_pass => 'dispersion_password',
:auth_version => '2.0',
:endpoint_type => 'publicURL',
:swift_dir => '/etc/swift',
:coverage => 1,
:retries => 5,
:concurrency => 25,
:dump_json => 'no' }
end
let :pre_condition do
@ -51,6 +52,8 @@ describe 'swift::dispersion' do
'dispersion/auth_user').with_value("#{p[:auth_tenant]}:#{p[:auth_user]}")
should contain_swift_dispersion_config(
'dispersion/auth_key').with_value(p[:auth_pass])
should contain_swift_dispersion_config(
'dispersion/endpoint_type').with_value(p[:endpoint_type])
should contain_swift_dispersion_config(
'dispersion/swift_dir').with_value(p[:swift_dir])
should contain_swift_dispersion_config(
@ -81,16 +84,17 @@ describe 'swift::dispersion' do
describe 'when parameters are overriden' do
before do
params.merge!(
:auth_url => 'https://10.0.0.10:7000/auth/v8.0/',
:auth_user => 'foo',
:auth_tenant => 'bar',
:auth_pass => 'dummy',
:auth_version => '1.0',
:swift_dir => '/usr/local/etc/swift',
:coverage => 42,
:retries => 51,
:concurrency => 4682,
:dump_json => 'yes'
:auth_url => 'https://10.0.0.10:7000/auth/v8.0/',
:auth_user => 'foo',
:auth_tenant => 'bar',
:auth_pass => 'dummy',
:auth_version => '1.0',
:endpoint_type => 'internalURL',
:swift_dir => '/usr/local/etc/swift',
:coverage => 42,
:retries => 51,
:concurrency => 4682,
:dump_json => 'yes'
)
end