Fix auth_token configuration.

- cache=swift.cache need to be in auth_token configuration not in
  keystoneauth.
- Make auth_token using the same facility for logging than main swift.

Closes-Bug: #1254487

Change-Id: If5a09da4d18f247dc42b99e6f666bc2867d06dcb
This commit is contained in:
Chmouel Boudjnah 2013-11-24 14:21:56 +01:00 committed by Emilien Macchi
parent 3566f9fa65
commit 000d63b654
6 changed files with 14 additions and 11 deletions

View File

@ -29,6 +29,8 @@
# Should be set to your public keystone endpoint (without version).
# [signing_dir] The cache directory for signing certificates.
# Defaults to '/var/cache/swift'
# [cache] the cache backend to use
# Optional. Defaults to 'swift.cache'
#
# == Authors
#
@ -50,7 +52,8 @@ class swift::proxy::authtoken(
$auth_uri = false,
$delay_auth_decision = 1,
$admin_token = false,
$signing_dir = '/var/cache/swift'
$signing_dir = '/var/cache/swift',
$cache = 'swift.cache'
) {
if $auth_uri {

View File

@ -8,8 +8,6 @@
# Must be an array of strings
# [is_admin] Set to true to allow users to set ACLs on their account.
# Optional. Defaults to true.
# [cache] the cache backend to use
# Optional. Defaults to 'swift.cache'
#
# == Authors
#
@ -19,8 +17,7 @@
class swift::proxy::keystone(
$operator_roles = ['admin', 'SwiftOperator'],
$is_admin = true,
$cache = 'swift.cache'
$is_admin = true
) {
concat::fragment { 'swift_keystone':

View File

@ -37,6 +37,7 @@ describe 'swift::proxy::authtoken' do
verify_contents(subject, fragment_file,
[
'[filter:authtoken]',
'log_name = swift',
'signing_dir = /var/cache/swift',
'paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory',
'auth_host = 127.0.0.1',
@ -47,6 +48,7 @@ describe 'swift::proxy::authtoken' do
'admin_user = swift',
'admin_password = password',
'delay_auth_decision = 1',
'cache = swift.cache',
]
)
end
@ -63,6 +65,7 @@ describe 'swift::proxy::authtoken' do
verify_contents(subject, fragment_file,
[
'[filter:authtoken]',
'log_name = swift',
'signing_dir = /var/cache/swift',
'paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory',
'auth_host = 127.0.0.1',
@ -71,6 +74,7 @@ describe 'swift::proxy::authtoken' do
'auth_uri = http://127.0.0.1:5000',
'admin_token = ADMINTOKEN',
'delay_auth_decision = 1',
'cache = swift.cache',
]
)
end
@ -86,6 +90,7 @@ describe 'swift::proxy::authtoken' do
:admin_tenant_name => 'admin',
:admin_user => 'swiftuser',
:admin_password => 'swiftpassword',
:cache => 'foo',
:delay_auth_decision => '0',
:signing_dir => '/home/swift/keystone-signing'
}
@ -95,6 +100,7 @@ describe 'swift::proxy::authtoken' do
verify_contents(subject, fragment_file,
[
'[filter:authtoken]',
'log_name = swift',
'signing_dir = /home/swift/keystone-signing',
'paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory',
'auth_host = some.host',
@ -106,6 +112,7 @@ describe 'swift::proxy::authtoken' do
'admin_user = swiftuser',
'admin_password = swiftpassword',
'delay_auth_decision = 0',
'cache = foo',
]
)
end

View File

@ -27,7 +27,6 @@ describe 'swift::proxy::keystone' do
it { should contain_file(fragment_file).with_content(/operator_roles = admin, SwiftOperator/) }
it { should contain_file(fragment_file).with_content(/is_admin = true/) }
it { should contain_file(fragment_file).with_content(/cache = swift.cache/) }
end
@ -37,12 +36,10 @@ describe 'swift::proxy::keystone' do
{
:operator_roles => 'foo',
:is_admin => 'false',
:cache => 'somecache'
}
it { should contain_file(fragment_file).with_content(/operator_roles = foo/) }
it { should contain_file(fragment_file).with_content(/is_admin = false/) }
it { should contain_file(fragment_file).with_content(/cache = somecache/) }
end

View File

@ -1,4 +1,5 @@
[filter:authtoken]
log_name = swift
signing_dir = <%= @signing_dir %>
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = <%= @auth_host %>
@ -17,4 +18,4 @@ admin_user = <%= @admin_user %>
admin_password = <%= @admin_password %>
<% end -%>
delay_auth_decision = <%= @delay_auth_decision %>
cache = <%= @cache %>

View File

@ -3,5 +3,3 @@
use = egg:swift#keystoneauth
operator_roles = <%= @operator_roles.to_a.join(', ') %>
is_admin = <%= @is_admin %>
cache = <%= @cache %>