From fb87555776c6715a480a49f00578e13263f2725c Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 22 Apr 2014 17:11:44 -0400 Subject: [PATCH] Remove redundant key deletion and gracefully tolerate deletion of non-existant key --- confluent/config/configmanager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/confluent/config/configmanager.py b/confluent/config/configmanager.py index 066e1bd2..0752ca35 100644 --- a/confluent/config/configmanager.py +++ b/confluent/config/configmanager.py @@ -810,13 +810,15 @@ class ConfigManager(object): continue _mark_dirtykey('groups', group, self.tenant) for attrib in attributes: - del groupentry[attrib] if attrib == 'nodes': groupentry['nodes'] = set() self._sync_nodes_to_group( group=group, nodes=(), changeset=changeset) else: - del groupentry[attrib] + try: + del groupentry[attrib] + except KeyError: + pass for node in groupentry['nodes']: nodecfg = self._cfgstore['nodes'][node] self._do_inheritance(