From a7cbf0130041041924beb6cb54bc23b6df656285 Mon Sep 17 00:00:00 2001 From: Yuvaraja Mariappan Date: Thu, 30 Mar 2017 21:01:49 -0700 Subject: [PATCH] Fixed issue in handling annotations in SecurityGroupKM Since the annotations value are sent in the second update, it is possible to get the none value for the first update. using empty dict on those cases would fix the issue. Change-Id: I35ca83fccaaa86f43779a085273231b2685885d3 Closes-bug: #1677439 --- src/container/kube-manager/kube_manager/vnc/config_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/container/kube-manager/kube_manager/vnc/config_db.py b/src/container/kube-manager/kube_manager/vnc/config_db.py index f8f0c6d6e5b..ab1f123871b 100644 --- a/src/container/kube-manager/kube_manager/vnc/config_db.py +++ b/src/container/kube-manager/kube_manager/vnc/config_db.py @@ -726,7 +726,7 @@ def update(self, obj=None): self.name = obj['fq_name'][-1] self.fq_name = obj['fq_name'] self.build_fq_name_to_uuid(self.uuid, obj) - self.annotations = obj.get('annotations', None) + self.annotations = obj.get('annotations', {}) for kvp in self.annotations.get('key_value_pair', []): if kvp.get('key') == 'namespace': self.namespace = kvp.get('value')