Handle exceptions while monitoring VNF

If any unknown exception occurs while monitoring VNFs,
then it exits while loop where run_monitor method is
called thereby stopping VNFs monitoring completely.

Handled unknown exception and logged an error message
so that operator is aware of this issue.

Closes-Bug: #1789829
Change-Id: I0b79a0a82e984a3c9a93fc123688ccd2018cc554
This commit is contained in:
bhagyashris 2018-08-30 14:01:45 +09:00
parent 21bd3f13c6
commit 6b9d92c52f
1 changed files with 6 additions and 2 deletions

View File

@ -99,8 +99,12 @@ class VNFMonitor(object):
if hosting_vnf.get('dead', False):
LOG.debug('monitor skips dead vnf %s', hosting_vnf)
continue
self.run_monitor(hosting_vnf)
try:
self.run_monitor(hosting_vnf)
except Exception as ex:
LOG.exception("Unknown exception: Monitoring failed "
"for VNF '%s' due to '%s' ",
hosting_vnf['id'], ex)
@staticmethod
def to_hosting_vnf(vnf_dict, action_cb):