2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-13 03:08:14 +00:00

Correct configmanager registration failures with no tenants

This commit is contained in:
jbjohnso 2014-04-21 17:01:25 -04:00
parent e0f6bfeec2
commit 640a6ece45

View File

@ -380,7 +380,7 @@ def _addchange(changeset, node, attrname):
def hook_new_configmanagers(callback):
'''Register callback for new tenants
"""Register callback for new tenants
From the point when this function is called until the end,
callback may be invoked to indicate a new tenant and
@ -389,11 +389,14 @@ def hook_new_configmanagers(callback):
:param callback: Function to call for each possible config manager
:returns: identifier that can be used to cancel this registration
'''
"""
#TODO(jbjohnso): actually live up to the promise of ongoing callbacks
callback(ConfigManager(None))
for tenant in _cfgstore['tenant'].iterkeys():
callback(ConfigManager(tenant))
try:
for tenant in _cfgstore['tenant'].iterkeys():
callback(ConfigManager(tenant))
except KeyError:
pass
class ConfigManager(object):