server's action confirm_resize return wrong status code v3

Bug #1233561 reported by Alex Xu
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Alex Xu

Bug Description

server's action confirm_resize return 204 now, but it should be 202

    @wsgi.response(202)
    @wsgi.serializers(xml=FullServerTemplate)
    @wsgi.deserializers(xml=ActionDeserializer)
    @wsgi.action('confirm_resize')
    def _action_confirm_resize(self, req, id, body):
        context = req.environ['nova.context']
        instance = self._get_server(context, req, id)
        try:
            self.compute_api.confirm_resize(context, instance)
        except exception.MigrationNotFound:
            msg = _("Instance has not been resized.")
            raise exc.HTTPBadRequest(explanation=msg)
        except exception.InstanceInvalidState as state_error:
            common.raise_http_conflict_for_instance_invalid_state(state_error,
                    'confirm_resize')
        return exc.HTTPNoContent()

The 'return exc.HTTPNoContent()' overwrite the '@wsgi.response(202)'

Tags: api
Alex Xu (xuhj)
tags: added: api
summary: - server's action confirm_resize return wrong status code
+ server's action confirm_resize return wrong status code v3
Changed in nova:
assignee: nobody → Alex Xu (xuhj)
Mathew Odden (locke105)
Changed in nova:
status: New → Confirmed
Revision history for this message
Alex Xu (xuhj) wrote :
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/45596
Committed: http://github.com/openstack/nova/commit/01a44568cc60bb5a6dd7b55d69b20bba57d1b94b
Submitter: Jenkins
Branch: master

commit 01a44568cc60bb5a6dd7b55d69b20bba57d1b94b
Author: He Jie Xu <email address hidden>
Date: Fri Sep 6 16:25:26 2013 +0800

    Fix status code of server's action confirm_resize for v3

    The status code of confirm_resize should be 202, but it
    returns 204 now. That because it returns HTTPNoContent
    that overwrites the status code of decorator 'wsgi.response(202)'

    And adds API samples for confirm_resize that used to test
    the status code of confirm_resize.

    Partially implements blueprint v3-api-unittests
    Closes-bug: #1233561

    Change-Id: I50a3046866af0a1efdb5c41ded40f973b02843e8

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.