2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 11:01:09 +00:00

Fix list_* functions to correctly handle non-existent collections

This commit is contained in:
Jarrod Johnson 2014-04-18 14:42:35 -04:00
parent cf4e8713ff
commit b9f4e14170

View File

@ -486,7 +486,10 @@ class ConfigManager(object):
def list_users(self):
return self._cfgstore['users'].iterkeys()
try:
return self._cfgstore['users'].iterkeys()
except KeyError:
return []
def get_user(self, name):
"""Get user information from DB
@ -580,7 +583,10 @@ class ConfigManager(object):
return self._cfgstore['groups'].iterkeys()
def list_nodes(self):
return self._cfgstore['nodes'].iterkeys()
try:
return self._cfgstore['nodes'].iterkeys()
except KeyError:
return []
def get_nodegroup_attributes(self, nodegroup, attributes=[]):
cfgnodeobj = self._cfgstore['groups'][nodegroup]