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',
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- except:
+ 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)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- except Exception:
+ 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 = {
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- except Exception:
+ 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 = {
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- except:
+ 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)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- except Exception:
+ 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)
except NFLCMException as e:
logger.error(e.message)
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
- except Exception:
+ 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 = {
# limitations under the License.
import logging
+import traceback
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)
- except:
+ 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):
# limitations under the License.
import logging
+import traceback
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:
+ 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='',