BaseException.message deprecated in py26

Bug #1070890 reported by Dolph Mathews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Dolph Mathews

Bug Description

Several tests are producing DeprecationWarnings, e.g.:

    test_create_duplicate_role_name_fails (test_backend_sql.SqlIdentity) ... [...]/keystone/identity/backends/sql.py:44: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
      raise exception.Conflict(type=type, details=e.message)
    ok

... due to the way the exception message (e.message) is accessed in the SQL identity driver:

    raise exception.Conflict(type=type, details=e.message)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/14767
Committed: http://github.com/openstack/keystone/commit/5bb5e7a3503536c0439aa4e1948291648c2a0277
Submitter: Jenkins
Branch: master

commit 5bb5e7a3503536c0439aa4e1948291648c2a0277
Author: Dolph Mathews <email address hidden>
Date: Wed Oct 24 10:13:54 2012 -0500

    Exception.message deprecated in py26 (bug 1070890)

    In the case of IntegrityError (e), e is wrapping a DBAPIError[1] with more
    information about the context of the exception -- context that we do NOT
    want to expose to our own API users (however, that context should still
    be logged). In the case of an integrity error, str(e.orig) will produce
    exactly what we're producing with e.message today: a user-friendly
    message such as 'column name is not unique'

    This change should not impact what is logged or returned to the API
    user -- just eliminate the deprecation warning.

    [1]: http://docs.sqlalchemy.org/en/rel_0_7/core/exceptions.html#sqlalchemy.exc.DBAPIError

    Change-Id: Ie3a5d93fbb5a7b90ad3b205bc8610f28b1626431

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: grizzly-1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.