s3 middleware depends on swift

Bug #1178738 reported by Adam Young on 2013-05-10
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Medium
Kun Huang

Bug Description

The s3 middleware imports:

from swift.common import utils as swift_utils

This is used to initiate the logging:

https://github.com/openstack/keystone/blob/master/keystone/middleware/s3_token.py#L57
 self.logger = swift_utils.get_logger(conf, log_route='s3token')

howerver, python has a standard logging framework, and we should not be bypassing that. It is up to the project that imports the middleware to set up logging properly, not up to the middleware to conform to multiple projects.

THis requires two things: 1, on the swift side, set up the custom logging using the standard python mechanism, and 2 getting this middleware to use the python logging framework.

Adam Young (ayoung) wrote :

the other place swift utils is used in this file is:

 parts = swift_utils.split_path(req.path, 1, 4, True)

which can easily be replaced as well.

Dolph Mathews (dolph) wrote :

keystone.middleware.swift_auth depends on swift as well.

Changed in keystone:
status: New → Confirmed
importance: Undecided → Medium

Fix proposed to branch: master
Review: https://review.openstack.org/38074

Changed in keystone:
assignee: nobody → Kun Huang (academicgareth)
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/38074
Committed: http://github.com/openstack/keystone/commit/55938e8b6048fe7138f4577ed276b81a52071db4
Submitter: Jenkins
Branch: master

commit 55938e8b6048fe7138f4577ed276b81a52071db4
Author: Kun Huang <email address hidden>
Date: Sun Jul 21 23:55:45 2013 +0800

    remove swift dependency of s3 middleware

    In middleware/s3_token.py, here only use swift for a logger and path
    split functionality. We should remove swift dependency by using new
    codes.

    fixes bug #1178738

    Change-Id: Icc2648720e220a873d1fb8e9961d777ceabef70b

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-09-05
Changed in keystone:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in keystone:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers