def _list(): """List all configured identity groups""" zkclient = context.GLOBAL.zk.conn groups = [ masterapi.get_identity_group(zkclient, group) for group in masterapi.identity_groups(zkclient) ] cli.out(formatter(groups))
def _list(match=None): """List configured identity groups.""" if match is None: match = '*' zkclient = context.GLOBAL.zk.conn groups = [ masterapi.get_identity_group(zkclient, group) for group in masterapi.identity_groups(zkclient) ] filtered = [ group for group in groups if group is not None and fnmatch.fnmatch(group['_id'], match) ] return sorted(filtered, key=lambda item: item['_id'])