From e42f9b622c0d4e72a88f030833eebb58f03ee459 Mon Sep 17 00:00:00 2001 From: Yuvaraja Mariappan Date: Fri, 26 Aug 2016 14:36:21 -0700 Subject: [PATCH] fix for service monitor sync issues with snat when the snat DB is corrupted, service monitor throws an exception and fails to sync with other snat services. Added validity code to check the object before it is used Change-Id: Ia512768f9d5749428256e56b5f472a4bf7cd260c Closes-bug: 1617043 --- src/config/svc-monitor/svc_monitor/snat_agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/svc-monitor/svc_monitor/snat_agent.py b/src/config/svc-monitor/svc_monitor/snat_agent.py index c4ad117e5ff..3b57f1e5dfd 100644 --- a/src/config/svc-monitor/svc_monitor/snat_agent.py +++ b/src/config/svc-monitor/svc_monitor/snat_agent.py @@ -22,7 +22,7 @@ def audit_snat_instances(self): for si in ServiceInstanceSM.values(): si_name = si.fq_name[-1] st_obj = ServiceTemplateSM.get(si.service_template) - if st_obj.params['service_type'] != "source-nat": + if st_obj == None or st_obj.params['service_type'] != "source-nat": continue lr_uuid = si.logical_router lr = LogicalRouterSM.get(lr_uuid)