From 530cb6440283471da2313e97db4cee0f8e2daa20 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 4 Apr 2014 09:28:09 -0400 Subject: [PATCH] Fix the 'everything' group behavior --- confluent/config/configmanager.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/confluent/config/configmanager.py b/confluent/config/configmanager.py index fb670a48..39780776 100644 --- a/confluent/config/configmanager.py +++ b/confluent/config/configmanager.py @@ -373,6 +373,11 @@ class ConfigManager(object): if 'main' not in _cfgstore: _cfgstore['main'] = {} self._cfgstore = _cfgstore['main'] + if 'groups' not in self._cfgstore: + self._cfgstore['groups'] = {'everything': {'nodes': set()}} + if 'nodes' not in self._cfgstore: + self._cfgstore['nodes'] = {} + self._bg_sync_to_file() return elif 'tenant' not in _cfgstore: _cfgstore['tenant'] = {tenant: {}} @@ -386,6 +391,7 @@ class ConfigManager(object): self._cfgstore['groups'] = {'everything': {}} if 'nodes' not in self._cfgstore: self._cfgstore['nodes'] = {} + self._bg_sync_to_file() def watch_attributes(self, nodes, attributes, callback): """ @@ -694,7 +700,7 @@ class ConfigManager(object): group = group.encode('utf-8') _mark_dirtykey('groups', group, self.tenant) if group not in self._cfgstore['groups']: - self._cfgstore['groups'][group] = {'nodes': set([])} + self._cfgstore['groups'][group] = {'nodes': set()} cfgobj = self._cfgstore['groups'][group] for attr in attribmap[group].iterkeys(): newdict = {}