ApiError error message if 'code' argument left out, becomes a redundant error
Bug #752818 reported by
John Tran
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
John Tran |
Bug Description
"ApiError: ApiError: Image must be available" is the output if :
raise exception.
Apparently, the code expects this behavior:
class ApiError(Error):$
def __init__(self, message='Unknown', code='ApiError'):$
...
super(ApiError, self).__init__('%s: %s' % (code, message))
The output thus becomes redundant and at first glance, I thought I accidentally nested the exception to cause it to repeat itself.
If the 'code' arg is left undefined, the output message should not specify a 'code' portion of the string at all. It should then output something like this instead:
"ApiError: Image must be available"
Related branches
lp:~jtran/nova/lp752818
- termie (community): Needs Fixing
- Josh Kearney (community): Approve
- Devin Carlen (community): Approve
- Vish Ishaya (community): Approve
- Brian Waldon (community): Approve
-
Diff: 59 lines (+40/-2)2 files modifiednova/exception.py (+6/-2)
nova/tests/test_exception.py (+34/-0)
Changed in nova: | |
assignee: | nobody → John Tran (jtran) |
Changed in nova: | |
status: | New → In Progress |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
status: | Fix Committed → In Progress |
Changed in nova: | |
importance: | Undecided → Low |
Changed in nova: | |
status: | In Progress → Fix Released |
To post a comment you must log in.