From f279c16d747beb9945d920073a160680c6929484 Mon Sep 17 00:00:00 2001 From: Sachin Bansal Date: Fri, 26 Feb 2016 16:56:56 -0800 Subject: [PATCH] Add a check for none before accessing variable The root cause of the bug was fixed with this review: https://review.opencontrail.org/#/c/17915/ However, adding a defensive check also in case we still hit the issue. Change-Id: Ib17229d652c588e3698a5df6c399f8a5264b90f8 Closes-Bug: 1550156 --- src/config/schema-transformer/config_db.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config/schema-transformer/config_db.py b/src/config/schema-transformer/config_db.py index 6c4785916ce..88b5b3750c1 100644 --- a/src/config/schema-transformer/config_db.py +++ b/src/config/schema-transformer/config_db.py @@ -1937,6 +1937,8 @@ def update_routing_policy_and_aggregates(self): if not self.service_chain: return sc = ServiceChain.get(self.service_chain) + if sc is None: + return for si_name in sc.service_list: if not self.name.endswith(si_name.replace(':', '_')): continue