Skip to content

Commit

Permalink
Use 201 instead of 200 for action create of flavor-manage v3
Browse files Browse the repository at this point in the history
All of v3 create action should return 201. Fix this for flavor-manage v3

Closes-bug: 1252162
DocImpact

Change-Id: I4fc698abdf89c93cb6ea0990ae43960f8c651d95
  • Loading branch information
soulxu committed Nov 18, 2013
1 parent 6fbb0b1 commit f0b35c8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions nova/api/openstack/compute/plugins/v3/flavor_manage.py
Expand Up @@ -51,6 +51,7 @@ def _delete(self, req, id):

return webob.Response(status_int=204)

@wsgi.response(201)
@wsgi.action("create")
@extensions.expected_errors((400, 409))
@wsgi.serializers(xml=flavors_api.FlavorTemplate)
Expand Down
Expand Up @@ -256,7 +256,7 @@ def test_create_flavor_name_with_leading_trailing_whitespaces(self):
req.method = 'POST'
req.body = jsonutils.dumps(request_dict)
res = req.get_response(self.app)
self.assertEqual(res.status_code, 200)
self.assertEqual(res.status_code, 201)
body = jsonutils.loads(res.body)
self.assertEqual("test", body["flavor"]["name"])

Expand Down
2 changes: 1 addition & 1 deletion nova/tests/integrated/v3/test_flavor_access.py
Expand Up @@ -39,7 +39,7 @@ def _create_flavor(self):
"flavor-access-create-req",
subs)
subs.update(self._get_regexes())
self._verify_response("flavor-access-create-resp", subs, response, 200)
self._verify_response("flavor-access-create-resp", subs, response, 201)

def test_flavor_access_create(self):
self._create_flavor()
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/integrated/v3/test_flavor_manage.py
Expand Up @@ -30,7 +30,7 @@ def _create_flavor(self):
"flavor-create-post-req",
subs)
subs.update(self._get_regexes())
self._verify_response("flavor-create-post-resp", subs, response, 200)
self._verify_response("flavor-create-post-resp", subs, response, 201)

def test_create_flavor(self):
# Get api sample to create a flavor.
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/integrated/v3/test_flavor_rxtx.py
Expand Up @@ -44,7 +44,7 @@ def test_flavors_rxtx_create(self):
'flavor-rxtx-post-req',
subs)
subs.update(self._get_regexes())
self._verify_response('flavor-rxtx-post-resp', subs, response, 200)
self._verify_response('flavor-rxtx-post-resp', subs, response, 201)


class FlavorRxtxXmlTest(FlavorRxtxJsonTest):
Expand Down

0 comments on commit f0b35c8

Please sign in to comment.