diff options
author | 2019-07-10 10:12:23 +0000 | |
---|---|---|
committer | 2019-07-10 10:12:23 +0000 | |
commit | b0a05961ea9bc959a675615d19c0f234b161c679 (patch) | |
tree | 1a1d4a53f2fdc42dcc5cf2cbe09c2f4257632ae3 | |
parent | ac64bf8b7cad1b00f693ed8e3c3e04e2272d01b5 (diff) | |
parent | 0461281fc32a84415d0375b3b62feb11e6aa8f52 (diff) |
Merge "Refactor codes for manual scale ns"
-rw-r--r-- | lcm/ns/tests/test_ns_manual_scale.py | 4 | ||||
-rw-r--r-- | lcm/ns/views/deprecated/common.py | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lcm/ns/tests/test_ns_manual_scale.py b/lcm/ns/tests/test_ns_manual_scale.py index e4c3c71f..4c31611b 100644 --- a/lcm/ns/tests/test_ns_manual_scale.py +++ b/lcm/ns/tests/test_ns_manual_scale.py @@ -131,7 +131,7 @@ class TestNsManualScale(TestCase): mock_start.side_effect = NSLCMException("NS scale failed.") response = self.client.post("/api/nslcm/v1/ns/%s/scale" % self.ns_inst_id, data={}, format='json') self.assertEqual(response.status_code, status.HTTP_500_INTERNAL_SERVER_ERROR) - self.assertIn("detail", response.data) + self.assertIn("error", response.data) @mock.patch.object(NSManualScaleService, 'start') def test_ns_manual_scale_when_ns_not_exist(self, mock_start): @@ -139,4 +139,4 @@ class TestNsManualScale(TestCase): scale_ns_json = SCALE_NS_DICT.copy() response = self.client.post("/api/nslcm/v1/ns/11/scale", data=scale_ns_json, format='json') self.assertEqual(response.status_code, status.HTTP_500_INTERNAL_SERVER_ERROR) - self.assertIn("detail", response.data) + self.assertIn("error", response.data) diff --git a/lcm/ns/views/deprecated/common.py b/lcm/ns/views/deprecated/common.py index ac1d312c..379a9481 100644 --- a/lcm/ns/views/deprecated/common.py +++ b/lcm/ns/views/deprecated/common.py @@ -27,8 +27,7 @@ logger = logging.getLogger(__name__) def make_error_resp(status, detail): return Response( data={ - 'status': status, - 'detail': detail + 'error': detail }, status=status ) |