Change-Id: Ie95e04333e1665f3d14cde716e8c8b175feef572
Issue-ID: VFC-630
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
self.assert_job_result(self.job_id, 255, "VNF nf_inst_id is not exist.")
@mock.patch.object(restcall, 'call_req')
self.assert_job_result(self.job_id, 255, "VNF nf_inst_id is not exist.")
@mock.patch.object(restcall, 'call_req')
- def test_instantiate_vnf_when_get_rawdata_by_csarid_failed(self, mock_call_req):
+ def test_instantiate_vnf_when_get_packageinfo_by_csarid_failed(self, mock_call_req):
NfInstModel.objects.create(nfinstid='1111',
nf_name='vFW_01',
package_id='222',
NfInstModel.objects.create(nfinstid='1111',
nf_name='vFW_01',
package_id='222',
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get Vnfs'},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get Vnfs'},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
rsp = {
logger.error(traceback.format_exc())
return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
rsp = {
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
rsp = {
logger.error(traceback.format_exc())
return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
rsp = {
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
+ except Exception as e:
+ logger.eror(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get Vnf(%s)' % instanceid},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
logger.error(traceback.format_exc())
return Response(data={'error': 'Failed to get Vnf(%s)' % instanceid},
status=status.HTTP_500_INTERNAL_SERVER_ERROR)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(data=None, status=status.HTTP_204_NO_CONTENT)
logger.error(traceback.format_exc())
return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(data=None, status=status.HTTP_204_NO_CONTENT)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
rsp = {
logger.error(traceback.format_exc())
return Response(data={'error': 'unexpected exception'}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
rsp = {
# limitations under the License.
import logging
# limitations under the License.
import logging
from lcm.pub.database.models import NfInstModel, NfvoRegInfoModel
from lcm.pub.exceptions import NFLCMException
from lcm.pub.database.models import NfInstModel, NfvoRegInfoModel
from lcm.pub.exceptions import NFLCMException
self.delete_info_from_db()
except NFLCMException as e:
logger.debug('Delete VNF instance[%s] failed: %s', self.nf_inst_id, e.message)
self.delete_info_from_db()
except NFLCMException as e:
logger.debug('Delete VNF instance[%s] failed: %s', self.nf_inst_id, e.message)
+ except Exception as e:
+ logger.error(e.message)
+ logger.error(traceback.format_exc())
logger.debug('Delete VNF instance[%s] failed' % self.nf_inst_id)
def check_parameter(self):
logger.debug('Delete VNF instance[%s] failed' % self.nf_inst_id)
def check_parameter(self):
JobUtil.add_job_status(self.job_id, 100, "Terminate Vnf success.")
except NFLCMException as e:
self.vnf_term_failed_handle(e.message)
JobUtil.add_job_status(self.job_id, 100, "Terminate Vnf success.")
except NFLCMException as e:
self.vnf_term_failed_handle(e.message)
+ except Exception as e:
+ logger.error(e.message)
self.vnf_term_failed_handle(traceback.format_exc())
def term_pre(self):
self.vnf_term_failed_handle(traceback.format_exc())
def term_pre(self):
# limitations under the License.
import logging
# limitations under the License.
import logging
import uuid
from lcm.pub.database.models import NfInstModel
import uuid
from lcm.pub.database.models import NfInstModel
except NFLCMException as e:
logger.debug('Create VNF instance[%s]: %s', self.nf_inst_id, e.message)
raise NFLCMException(e.message)
except NFLCMException as e:
logger.debug('Create VNF instance[%s]: %s', self.nf_inst_id, e.message)
raise NFLCMException(e.message)
+ except Exception as e:
+ logger.error(e.message)
+ logger.error(traceback.format_exc())
NfInstModel.objects.create(nfinstid=self.nf_inst_id,
nf_name=self.vnf_instance_mame,
package_id='',
NfInstModel.objects.create(nfinstid=self.nf_inst_id,
nf_name=self.vnf_instance_mame,
package_id='',
JobUtil.add_job_status(self.job_id, 100, "Instantiate Vnf success.")
except NFLCMException as e:
self.vnf_inst_failed_handle(e.message)
JobUtil.add_job_status(self.job_id, 100, "Instantiate Vnf success.")
except NFLCMException as e:
self.vnf_inst_failed_handle(e.message)
+ except Exception as e:
+ logger.error(e.message)
logger.error(traceback.format_exc())
self.vnf_inst_failed_handle('unexpected exception')
logger.error(traceback.format_exc())
self.vnf_inst_failed_handle('unexpected exception')