Arg values not being populated in exceptions report by CLI

Bug #835216 reported by Sumit Naiksatam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
dan wendlandt
quantum (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Precise by Yolanda Robla

Bug Description

As can be seen below, values are not being matched with args (i.e. net_id, port_id)

# python bin/cli rename_net demo 7cc3e4c1-cc21-467d-93bc-643b895fe2d test-net-2
Exception:<class 'quantum.common.exceptions.NetworkNotFound'> - Network %(net_id)s could not be found

# python bin/cli delete_net demo 7cc3e4c1-cc21-467d-93bc-643b895fe2d5
Exception:<class 'quantum.common.exceptions.NetworkInUse'> - Unable to complete operation on network %(net_id)s. There is one or more attachments plugged into its ports.

# PYTHONPATH=. python bin/cli delete_port -H 10.10.2.6 demo 528b38b4-5d67-4258-9b19-eef3b5fd04f3 1834b3a7-6325-494b-b931-0bf6c0c8937
Exception:<class 'quantum.common.exceptions.PortNotFound'> - Port %(port_id)s could not be found on network %(net_id)s

Related branches

Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

Thanks for spotting this Sumit!

I reckon this bugs comes from:
- a recent update in client library to use Quantum Exceptions rather than a custom-generated exception message
- yesterday's update to the CLI which uses such exception messages

Fixing this bug should not be too hard. I think the best place for fixing it is the client library rather than the CLI.

dan wendlandt (danwent)
Changed in quantum:
importance: Undecided → High
milestone: none → diablo-rbp
dan wendlandt (danwent)
Changed in quantum:
assignee: nobody → dan wendlandt (danwent)
status: New → In Progress
Revision history for this message
dan wendlandt (danwent) wrote :

This turned out to be an issue with the client lib. The diff for the change is pretty large, but the approach is conceptually simple: for each call to do_request, we can pass in a kwargs dict that will be passed if we create an exception as a result of an error code. This let's us populate the exception messages with the correct values (e.g., the net-id that was not found when we get a 404 trying to access a network).

dan wendlandt (danwent)
Changed in quantum:
status: In Progress → Fix Committed
dan wendlandt (danwent)
Changed in quantum:
status: Fix Committed → Fix Released
Changed in quantum (Ubuntu):
status: New → Fix Released
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.