diff options
author | Fu Jinhua <fu.jinhua@zte.com.cn> | 2018-11-03 06:57:28 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-11-03 06:57:28 +0000 |
commit | 46eaf6719b0ddffe445db6b93e05c7dd4a653de9 (patch) | |
tree | 8ac8cd6cb4776270de0a98109128deb8a7101c9f | |
parent | bf313724f3c4ff44353ab31e569286f777f7f3cd (diff) | |
parent | 708d7996cfb0c428bb42c9f3531c6cd64b85780e (diff) |
Merge "enhace the get NS interfaces"
-rw-r--r-- | lcm/ns/biz/ns_get.py | 2 | ||||
-rw-r--r-- | lcm/ns/tests/test_ns_get.py | 1 | ||||
-rw-r--r-- | lcm/ns/views/get_del_ns_view.py | 2 |
3 files changed, 2 insertions, 3 deletions
diff --git a/lcm/ns/biz/ns_get.py b/lcm/ns/biz/ns_get.py index 31d26866..2e572a3d 100644 --- a/lcm/ns/biz/ns_get.py +++ b/lcm/ns/biz/ns_get.py @@ -41,7 +41,7 @@ class GetNSInfoService(object): 'description': ns_inst.description, 'nsdId': ns_inst.nsd_id, 'nsdInvariantId': ns_inst.nsd_invariant_id, - 'vnfInfoId': self.get_vnf_infos(ns_inst.id), + 'vnfInfo': self.get_vnf_infos(ns_inst.id), 'vlInfo': self.get_vl_infos(ns_inst.id), 'vnffgInfo': self.get_vnffg_infos(ns_inst.id, ns_inst.nsd_model), 'nsState': ns_inst.status} diff --git a/lcm/ns/tests/test_ns_get.py b/lcm/ns/tests/test_ns_get.py index 32e5d1fb..cd4a94a8 100644 --- a/lcm/ns/tests/test_ns_get.py +++ b/lcm/ns/tests/test_ns_get.py @@ -27,7 +27,6 @@ class TestNsQuery(TestCase): response = self.client.get("/api/nslcm/v1/ns/1")
self.failUnlessEqual(status.HTTP_200_OK, response.status_code)
self.assertIsNotNone(response.data)
- self.assertEqual(1, len(response.data))
def test_query_all_nsinstance(self):
response = self.client.get("/api/nslcm/v1/ns")
diff --git a/lcm/ns/views/get_del_ns_view.py b/lcm/ns/views/get_del_ns_view.py index 6ea97da1..02cfdc97 100644 --- a/lcm/ns/views/get_del_ns_view.py +++ b/lcm/ns/views/get_del_ns_view.py @@ -44,7 +44,7 @@ class NSDetailView(APIView): if not ret: return Response(status=status.HTTP_404_NOT_FOUND) logger.debug("Leave NSDetailView::get::ret=%s", ret) - resp_serializer = QueryNsRespSerializer(data=ret, many=True) + resp_serializer = QueryNsRespSerializer(data=ret[0]) if not resp_serializer.is_valid(): raise NSLCMException(resp_serializer.errors) return Response(data=resp_serializer.data, status=status.HTTP_200_OK) |