Refine HTTP error code for os-interface

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

Bug Description

Related bug --> https://bugs.launchpad.net/nova/+bug/1363901

When attaching interface to an instance, Neutron may return several types of error to Nova (Eg. PortNotFound, PortInUse and etc.) Nova need to translate those error into a correct HTTP error code, so that end user will be able to know the exact failure reason.

According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html, my proposed mapping between Nova error and HTTP error code is:

PortNotFound 404
FixedIpAlreadyInUse 409
PortInUse 409
NetworkDuplicated 400
NetworkAmbiguous 400
NetworkNotFound 404

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/128191

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

Reviewed: https://review.openstack.org/128191
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5b4bd2aa16c123b11ac9dcf34354a0de3f2a1d1a
Submitter: Jenkins
Branch: master

commit 5b4bd2aa16c123b11ac9dcf34354a0de3f2a1d1a
Author: Qin Zhao <email address hidden>
Date: Tue Oct 14 15:08:12 2014 +0800

    Refine HTTP error code for os-interface

    When attaching interface to an instance, Neutron may return several types of
    errors. Nova need to translate those errors into appropriate HTTP error codes,
    so that end user will be able to know the exact failure reason. Propose to
    change the following mappings:

    PortNotFound - 400 --> 404
    PortInUse - 400 --> 409
    NetworkNotFound - 400 --> 404
    FixedIpAlreadyInUse - 400 --> 409

    In order to keep V2 api backward-compatibility, only propose to adjust the
    error code of V2.1/V3 api.

    Change-Id: Icc80c1f847bb9c5737e7282ce8543be52cde8f89
    Closes-Bug: 1380901

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