some exception messages of trust manager are not formatted

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

Bug Description

There are three unformatted exceptions in trust manager:
https://github.com/openstack/keystone/blob/master/keystone/trust/core.py#L56
https://github.com/openstack/keystone/blob/master/keystone/trust/core.py#L65
https://github.com/openstack/keystone/blob/master/keystone/trust/core.py#L140

The test code is as follow:
>>> from keystone import exception
>>> from keystone.i18n import _
>>> from keystone import config
>>> CONF = config.CONF
>>> CONF.debug=True
>>> raise exception.Forbidden(_('%(redelegation_depth)d [0..%(max_count)d]'), redelegation_depth=1, max_count=2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
keystone.exception.Forbidden: %(redelegation_depth)d [0..%(max_count)d] (Disable debug mode to suppress these details.)

wanghong (w-wanghong)
Changed in keystone:
assignee: nobody → wanghong (w-wanghong)
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/149550

Changed in keystone:
status: New → In Progress
Changed in keystone:
milestone: none → kilo-rc1
Changed in keystone:
importance: Undecided → Medium
importance: Medium → Low
Changed in keystone:
assignee: wanghong (w-wanghong) → Morgan Fainberg (mdrnstm)
Changed in keystone:
assignee: Morgan Fainberg (mdrnstm) → wanghong (w-wanghong)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

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

commit 0bdde48eee268992e2caf97b1b9a3d184877297b
Author: Morgan Fainberg <email address hidden>
Date: Thu Mar 26 16:55:41 2015 -0700

    Make trust manager raise formatted message exception

    Keystone Exception doesn't support the following use:
    raise exception.Forbidden(_('%(xx)d %(yy)d]'), xx=1, yy=2)
    This can lead to a bug that we will get a unformatted message when
    error happens.

    Change-Id: I8a9d4b61eaed8575fe1473ccf5d54a4efe752f21
    Closes-Bug: #1413905

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: kilo-rc1 → 2015.1.0
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.