summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-02-27 09:50:37 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-02-27 09:58:37 +0800
commitcdc405f4119d24a069932b0c446c55a2b8d40bdd (patch)
tree129f41c76424da3ce7d8761186ef831d8363bd0b
parent77b85970c5b48c33d7d88965a41fefb26edb9e21 (diff)
Modify code of gvnfm vnflcm
Change-Id: Ib27c604cd0f653017ac17696929c00203bf865d1 Issue-Id: GVNFM-12 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py6
-rw-r--r--lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py2
-rw-r--r--lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py b/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py
index 84411aef..09e209db 100644
--- a/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py
+++ b/lcm/lcm/nf/vnfs/tests/test_vnf_cancel.py
@@ -57,7 +57,7 @@ class TestNFTerminate(TestCase):
def test_delete_vnf_identifier(self):
NfInstModel.objects.create(nfinstid='1111', nf_name='2222', package_id='todo', version='', vendor='',
- netype='', vnfd_model='', status='VNF_INSTANTIATED', nf_desc='', vnfdid='',
+ netype='', vnfd_model='', status='NOT_INSTANTIATED', nf_desc='', vnfdid='',
vnfSoftwareVersion='', vnfConfigurableProperties='todo',
localizationLanguage='EN_US', create_time=now_time())
response = self.client.delete("/openoapi/vnflcm/v1/vnf_instances/1111")
@@ -71,12 +71,12 @@ class TestNFTerminate(TestCase):
def test_delete_vnf_identifier_when_status_check_failed(self):
NfInstModel.objects.create(nfinstid='1111', nf_name='2222', package_id='todo', version='', vendor='',
- netype='', vnfd_model='', status='NOT_INSTANTIATED', nf_desc='', vnfdid='',
+ netype='', vnfd_model='', status='VNF_INSTANTIATED', nf_desc='', vnfdid='',
vnfSoftwareVersion='', vnfConfigurableProperties='todo',
localizationLanguage='EN_US', create_time=now_time())
response = self.client.delete("/openoapi/vnflcm/v1/vnf_instances/1111")
self.failUnlessEqual(status.HTTP_500_INTERNAL_SERVER_ERROR, response.status_code)
- self.assertEqual("Don't allow to delete vnf(status:[NOT_INSTANTIATED])", response.data["error"])
+ self.assertEqual("Don't allow to delete vnf(status:[VNF_INSTANTIATED])", response.data["error"])
@mock.patch.object(TermVnf, 'run')
def test_terminate_vnf(self, mock_run):
diff --git a/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py b/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py
index c5a92c08..c3772a23 100644
--- a/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py
+++ b/lcm/lcm/nf/vnfs/vnf_cancel/delete_vnf_identifier.py
@@ -29,6 +29,6 @@ class DeleteVnf:
if not vnf_insts.exists():
raise NFLCMException('VnfInst(%s) does not exist' % self.nf_inst_id)
sel_vnf = vnf_insts[0]
- if sel_vnf.status != 'VNF_INSTANTIATED':
+ if sel_vnf.status != 'NOT_INSTANTIATED':
raise NFLCMException("Don't allow to delete vnf(status:[%s])" % sel_vnf.status)
NfInstModel.objects.filter(nfinstid=self.nf_inst_id).delete()
diff --git a/lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py b/lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py
index c9d1c12f..2775b42a 100644
--- a/lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py
+++ b/lcm/lcm/nf/vnfs/vnf_cancel/term_vnf.py
@@ -66,7 +66,7 @@ class TermVnf(Thread):
raise NFLCMException('VnfInst(%s) does not exist' % self.nf_inst_id)
sel_vnf = vnf_insts[0]
if sel_vnf.status != 'VNF_INSTANTIATED':
- raise NFLCMException("Don't allow to delete vnf(status:[%s])" % sel_vnf.status)
+ raise NFLCMException("Don't allow to terminate vnf(status:[%s])" % sel_vnf.status)
if self.terminationType == 'GRACEFUL' and not self.gracefulTerminationTimeout:
raise NFLCMException("Graceful termination must set timeout")