summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorhongyuzhao <zhao.hongyu@zte.com.cn>2019-09-24 10:53:56 +0800
committerhongyuzhao <zhao.hongyu@zte.com.cn>2019-09-24 10:55:34 +0800
commit19c8f17c4191e47cf15dce4d5ed48716a1c78c59 (patch)
tree7637a9a50bac195b7c25645fe56d151ba2449d8c /lcm
parent1d4ae57b08ce589f2c8eefbfb4457f0d84bc972d (diff)
Code optimization5.0.2-ONAPelalto
Change-Id: I5f620e6b8573d487aa1d17f5e3eb30dc1bb21097 Issue-ID: VFC-1431 Signed-off-by: hongyuzhao <zhao.hongyu@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/tests/test_create_vnf.py6
-rw-r--r--lcm/lcm/nf/views/curd_vnf_views.py7
2 files changed, 11 insertions, 2 deletions
diff --git a/lcm/lcm/nf/tests/test_create_vnf.py b/lcm/lcm/nf/tests/test_create_vnf.py
index 240ed17f..1272d381 100644
--- a/lcm/lcm/nf/tests/test_create_vnf.py
+++ b/lcm/lcm/nf/tests/test_create_vnf.py
@@ -106,9 +106,13 @@ class TestNFInstantiate(TestCase):
expect_data = {
"id": "1",
"vnfProvider": "huawei",
+ 'vnfInstanceDescription': 'vFW in Nanjing TIC Edge',
+ 'vnfInstanceName': 'vFW_01',
"vnfdVersion": "1.0",
"vnfPkgId": "111",
- "instantiationState": "NOT_INSTANTIATED"
+ "instantiationState": "NOT_INSTANTIATED",
+ 'vnfSoftwareVersion': '1.0',
+ 'vnfdId': '111'
}
self.assertEqual(status.HTTP_201_CREATED, response.status_code)
self.assertEqual(expect_data, response.data)
diff --git a/lcm/lcm/nf/views/curd_vnf_views.py b/lcm/lcm/nf/views/curd_vnf_views.py
index fa57f2ed..37e46ff3 100644
--- a/lcm/lcm/nf/views/curd_vnf_views.py
+++ b/lcm/lcm/nf/views/curd_vnf_views.py
@@ -74,10 +74,15 @@ class CreateVnfAndQueryVnfs(APIView):
nf_inst = CreateVnf(request.data).do_biz()
rsp_data = {"id": nf_inst.nfinstid,
+ "vnfInstanceName": nf_inst.nf_name,
+ "vnfdId": nf_inst.vnfdid,
"vnfProvider": nf_inst.vendor,
+ "vnfSoftwareVersion": nf_inst.vnfSoftwareVersion,
"vnfdVersion": nf_inst.version,
"vnfPkgId": nf_inst.package_id,
- "instantiationState": nf_inst.status}
+ "instantiationState": nf_inst.status,
+ "vnfInstanceDescription": nf_inst.nf_desc
+ }
create_vnf_resp_serializer = VnfInstanceSerializer(data=rsp_data)
if not create_vnf_resp_serializer.is_valid():
raise NFLCMException(create_vnf_resp_serializer.errors)