Association of not allocated floating IP or floating IP allocated for another project are not throwing proper error messages

Bug #1057906 reported by Sirisha Devineni
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Sirisha Devineni

Bug Description

While trying to associate floating IP to an instance, following exceptions are not throwing proper error messages instead displaying a generic message "ERROR: Error. Unable to associate floating ip (HTTP 400)".

$ nova add-floating-ip 98fef839-d651-4d52-8803-0015042b45a0 172.24.4.226
$ERROR: Error. Unable to associate floating ip (HTTP 400) (Request-ID: req-b3de0fd5-edb2-453f-9677-14c733441644)
Expected Result: Address not allocated to your project or not authorized to use the address

$ nova add-floating-ip 98fef839-d651-4d52-8803-0015042b45a0 10.233.52.7
$Error. Unable to associate floating ip (HTTP 400)
Expected Result: Floating ip not found for address 10.233.52.7

In $nova/api/openstack/contrib/floating_ips.py:FloatingIPActionController._add_floating_ip(), only FloatingIpAssociated, NoFloatingIpInterface exceptions are handled specifically and all other exceptions are handled in a generic way "Exception".
If the error messages for above two scenarios can be specific to the point, it will be easy to user to identify the problem.

Changed in nova:
assignee: nobody → Sirisha Devineni (sirisha-devineni)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

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

Reviewed: https://review.openstack.org/13826
Committed: http://github.com/openstack/nova/commit/5b0494f877ec1cb95bb18b8608a341c21109832f
Submitter: Jenkins
Branch: master

commit 5b0494f877ec1cb95bb18b8608a341c21109832f
Author: Sirisha Devineni <email address hidden>
Date: Fri Sep 28 21:33:49 2012 +0530

    Return proper error messages while associating floating IP

    Handled the FloatingIpNotFoundForAddress, NotAuthorized exceptions
    raised while associating floating IPs which are not allocated
    or allocated to another project.

    Fixes bug 1057906

    Change-Id: I2d6eba9159b4e855fe615ed4dfa23c388d28c6d0

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
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.