Fix response code and improve error message network not found

Bug #1245696 reported by Aaron Rosen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Aaron Rosen

Bug Description

When booting an instance if the network_uuid is not of a valid network the following error is returned:

ERROR: The resource could not be found. (HTTP 404) (Request-ID: req-f86b297f-bbec-4ca1-93f9-f495250f1a3f) (This doesn't really tell the user what resource is not found which should be improved).

In addition http response code should be 400 not 404 to align with other resources i.e security_groups:
ERROR: Unable to find security_group with name 'asdfasdf' (HTTP 400) (Request-ID: req-ff8b528a-50cf-4ca5-9598-b9ed1a69482d)

Tags: network
Aaron Rosen (arosen)
Changed in nova:
assignee: nobody → Aaron Rosen (arosen)
tags: added: network
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/54202

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/54202
Committed: http://github.com/openstack/nova/commit/fa1857184db370ff78b9b7344be5f3a1030b862f
Submitter: Jenkins
Branch: master

commit fa1857184db370ff78b9b7344be5f3a1030b862f
Author: Aaron Rosen <email address hidden>
Date: Mon Oct 28 15:25:42 2013 -0700

    Fix HTTP response code for network APIs and improve error message

    This patch corrects the http response codes for network resources to be
    consistant with other resources by returning a 400 instead of a 404
    if the desired resource is not found.

    This patch makes the following api changes:

    v2-api: NetworkNotFound now returns 400 instead of 404 and improved error
            message which network was not found instead of
            'The resource could not be found'.

    v3-api: PortNotFound and NetworkNotFound now returns a 400 instead of a 404.

    Closes-bug: #1245696
    DocImpact

    Change-Id: I66eb0c0ab926e0a8d1e2c9cfe1f7fd579ea3da21

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