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:
parent
cf4e8713ff
commit
b9f4e14170
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user