Unauthorized exception causes missing exception kwargs (programmer error)

Bug #1607107 reported by Ron De Rose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
David Stanek

Bug Description

I created the following class in keystone/exception.py:

class AccountLocked(Unauthorized):
    message_format = _("The account is locked for user: %(user_id)s")

And would raise the exception if a user account was locked:
raise exception.AccountLocked(user_id=user_id)

However when doing so, the following error would get logged:
missing exception kwargs (programmer error)

This seems to be a product of:
https://github.com/openstack/keystone/blob/master/keystone/exception.py#L61-L67

A few of us spent time on this in IRC. For more content you can view that conversation here:
http://eavesdrop.openstack.org/irclogs/%23openstack-keystone/%23openstack-keystone.2016-07-27.log.html#t2016-07-27T14:49:24

Changed in keystone:
assignee: nobody → David Stanek (dstanek)
status: New → In Progress
Revision history for this message
Steve Martinelli (stevemar) wrote :
Changed in keystone:
assignee: David Stanek (dstanek) → Lance Bragstad (lbragstad)
importance: Undecided → Medium
milestone: none → newton-3
Changed in keystone:
assignee: Lance Bragstad (lbragstad) → David Stanek (dstanek)
Revision history for this message
Steve Martinelli (stevemar) wrote :

Not sure why this wasn't updated, https://review.openstack.org/#/c/348086/ closed it out.

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

Reviewed: https://review.openstack.org/348085
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=fd861dca5fb91adbf812c36df07917bd806dfdfa
Submitter: Jenkins
Branch: master

commit fd861dca5fb91adbf812c36df07917bd806dfdfa
Author: David Stanek <email address hidden>
Date: Wed Jul 27 22:39:50 2016 +0000

    Adds test for SecurityError's translation behavior

    A confusing log message is logged when translating SecurityErrors within
    another translated string.

    Related-bug: #1607107
    Change-Id: I315e68462d7096a2cbc38c1717b549d59719b71b

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

Reviewed: https://review.openstack.org/348086
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=a14add150accfe8773ae482ebc7a941c1360fd68
Submitter: Jenkins
Branch: master

commit a14add150accfe8773ae482ebc7a941c1360fd68
Author: David Stanek <email address hidden>
Date: Wed Jul 27 23:05:11 2016 +0000

    Adds a custom deepcopy handler

    This allows the SecurityErrors to be deep copied without causing
    annoying warning in the logs.

    Closes-Bug: #1607107
    Change-Id: I24635dd5ab10f736b82e9fea4d0a36b1a45c27f1

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/keystone 10.0.0.0b3

This issue was fixed in the openstack/keystone 10.0.0.0b3 development milestone.

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.