mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
rgw: don't initialize keystone if not set up
Fixes: #3653 No need to initialize keystone, including the keystone revocation thread which was verbose if key stone was not set up. This removes some unuseful errors from the log. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
This commit is contained in:
parent
799c59ae89
commit
08c64249eb
@ -644,7 +644,7 @@ bool RGWSwift::verify_swift_token(RGWRados *store, req_state *s)
|
||||
|
||||
int ret;
|
||||
|
||||
if (!cct->_conf->rgw_keystone_url.empty()) {
|
||||
if (supports_keystone()) {
|
||||
ret = validate_keystone_token(store, s->os_auth_token, &info, s->user);
|
||||
return (ret >= 0);
|
||||
}
|
||||
@ -678,7 +678,13 @@ bool RGWSwift::verify_swift_token(RGWRados *store, req_state *s)
|
||||
void RGWSwift::init()
|
||||
{
|
||||
get_str_list(cct->_conf->rgw_keystone_accepted_roles, roles_list);
|
||||
if (supports_keystone())
|
||||
init_keystone();
|
||||
}
|
||||
|
||||
|
||||
void RGWSwift::init_keystone()
|
||||
{
|
||||
keystone_token_cache = new RGWKeystoneTokenCache(cct, cct->_conf->rgw_keystone_token_cache_size);
|
||||
|
||||
keystone_revoke_thread = new KeystoneRevokeThread(cct, this);
|
||||
@ -687,6 +693,12 @@ void RGWSwift::init()
|
||||
|
||||
|
||||
void RGWSwift::finalize()
|
||||
{
|
||||
if (supports_keystone())
|
||||
finalize_keystone();
|
||||
}
|
||||
|
||||
void RGWSwift::finalize_keystone()
|
||||
{
|
||||
delete keystone_token_cache;
|
||||
keystone_token_cache = NULL;
|
||||
|
@ -64,11 +64,16 @@ class RGWSwift {
|
||||
|
||||
void init();
|
||||
void finalize();
|
||||
void init_keystone();
|
||||
void finalize_keystone();
|
||||
bool supports_keystone() {
|
||||
return !cct->_conf->rgw_keystone_url.empty();
|
||||
}
|
||||
protected:
|
||||
int check_revoked();
|
||||
public:
|
||||
|
||||
RGWSwift(CephContext *_cct) : cct(_cct) {
|
||||
RGWSwift(CephContext *_cct) : cct(_cct), keystone_revoke_thread(NULL) {
|
||||
init();
|
||||
}
|
||||
~RGWSwift() {
|
||||
|
Loading…
Reference in New Issue
Block a user