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:
@@ -99,8 +99,12 @@ class VNFMonitor(object):
if hosting_vnf.get('dead', False):
LOG.debug('monitor skips dead vnf %s', hosting_vnf)
continue
-
+ 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):
