Change-Id: I401644a600a5afb0769bdc6c812d7ce2b8f51c60
Issue-ID: VFC-838
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
allow_null=True)
vnfState = serializers.ChoiceField(
help_text="vnfState",
allow_null=True)
vnfState = serializers.ChoiceField(
help_text="vnfState",
- choices=["STARTED", "STOPPED", "NOT_INSTANTIATED", "INSTANTIATED"],
+ choices=["STARTED", "STOPPED", "NOT_INSTANTIATED", "INSTANTIATED", "FAILED"],
required=True,
allow_null=True)
scaleStatus = ScaleInfoSerializer(
required=True,
allow_null=True)
scaleStatus = ScaleInfoSerializer(
create_time=now_time())
t1_apply_grant_result = [0, json.JSONEncoder().encode(
{
create_time=now_time())
t1_apply_grant_result = [0, json.JSONEncoder().encode(
{
- "vim": {
- "vimid": 'vimid_1',
- "accessinfo": {
- "tenant": 'tenantname_1'
- }
- }
+ "vimid": 'vimid_1',
+ "tenant": 'tenantname_1'
}), '200']
t2_lcm_notify_result = [0, json.JSONEncoder().encode(''), '200']
mock_call_req.side_effect = [t1_apply_grant_result, t2_lcm_notify_result]
}), '200']
t2_lcm_notify_result = [0, json.JSONEncoder().encode(''), '200']
mock_call_req.side_effect = [t1_apply_grant_result, t2_lcm_notify_result]
def setUp(self):
self.client = APIClient()
self.grant_result = {
def setUp(self):
self.client = APIClient()
self.grant_result = {
- "vim": {
- "vimid": 'vimid_1',
- "accessinfo": {
- "tenant": 'tenantname_1'
- }
- }
+ "vimid": 'vimid_1',
+ "tenant": 'tenantname_1'
lastuptime=now_time())
logger.info("self.vim_id = %s" % self.vim_id)
lastuptime=now_time())
logger.info("self.vim_id = %s" % self.vim_id)
- NfvoRegInfoModel.objects.create(
- nfvoid=self.nf_inst_id,
- vnfminstid=ignore_case_get(self.data, "vnfmId"),
- apiurl=self.vim_id)
+ is_exist = NfvoRegInfoModel.objects.filter(nfvoid=self.nf_inst_id).exists()
+ if not is_exist:
+ NfvoRegInfoModel.objects.create(
+ nfvoid=self.nf_inst_id,
+ vnfminstid=ignore_case_get(self.data, "vnfmId"),
+ apiurl=self.vim_id)
JobUtil.add_job_status(self.job_id, 15, 'Nf instancing pre-check finish')
logger.info("Nf instancing pre-check finish")
JobUtil.add_job_status(self.job_id, 15, 'Nf instancing pre-check finish')
logger.info("Nf instancing pre-check finish")
def vnf_inst_failed_handle(self, error_msg):
logger.error('VNF instantiation failed, detail message: %s' % error_msg)
def vnf_inst_failed_handle(self, error_msg):
logger.error('VNF instantiation failed, detail message: %s' % error_msg)
- NfInstModel.objects.filter(nfinstid=self.nf_inst_id).update(status='failed', lastuptime=now_time())
+ NfInstModel.objects.filter(nfinstid=self.nf_inst_id).update(status='FAILED', lastuptime=now_time())
JobUtil.add_job_status(self.job_id, 255, error_msg)
def do_notify(self, res_type, ret):
JobUtil.add_job_status(self.job_id, 255, error_msg)
def do_notify(self, res_type, ret):