summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaibin Huang <haibin.huang@intel.com>2018-11-14 08:22:33 +0000
committerHaibin Huang <haibin.huang@intel.com>2018-11-14 09:39:32 +0000
commit458989f38849f5a2b2967a73a2160f5876faad71 (patch)
treebb9ae4c62b28db9a3128faeb26672ba07270d6e3
parent69c7fffdcc22bc47a84775a7214b0495efa04baf (diff)
Modify openstack return code
Change-Id: Ic124a91704b4e61d94626855a3592a29bad51738 Issue-ID: MULTICLOUD-404 Signed-off-by: Haibin Huang <haibin.huang@intel.com>
-rw-r--r--newton/newton/requests/tests/test_flavor.py4
-rw-r--r--share/newton_base/openoapi/flavor.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/newton/newton/requests/tests/test_flavor.py b/newton/newton/requests/tests/test_flavor.py
index 4a9df9c5..ef7ec86a 100644
--- a/newton/newton/requests/tests/test_flavor.py
+++ b/newton/newton/requests/tests/test_flavor.py
@@ -174,7 +174,7 @@ class TestFlavorsNewton(unittest.TestCase, AbstractTestResource):
"content": self.MOCK_GET_RESOURCES_RESPONSE},
"post": {
"content": self.MOCK_POST_RESOURCE_RESPONSE,
- "status_code": status.HTTP_202_ACCEPTED,
+ "status_code": status.HTTP_200_OK,
}
}
),
@@ -190,7 +190,7 @@ class TestFlavorsNewton(unittest.TestCase, AbstractTestResource):
HTTP_X_AUTH_TOKEN=mock_info.MOCK_TOKEN_ID)
context = response.json()
- self.assertEquals(status.HTTP_202_ACCEPTED,
+ self.assertEquals(status.HTTP_200_OK,
response.status_code)
self.assertIsNotNone(context['id'])
self.assertEqual(1, context['returnCode'])
diff --git a/share/newton_base/openoapi/flavor.py b/share/newton_base/openoapi/flavor.py
index b0a6bf6c..8dcd10f6 100644
--- a/share/newton_base/openoapi/flavor.py
+++ b/share/newton_base/openoapi/flavor.py
@@ -232,7 +232,7 @@ class Flavors(APIView):
extra_specs_vfc = request.data.pop("extraSpecs", None)
#create flavor first
resp = self._create_flavor(sess, request)
- if resp.status_code == 202:
+ if resp.status_code == 200:
resp_body = resp.json()["flavor"]
else:
return resp