def execute(self, ns, groups): if groups: for group in groups: inst = account.get_group(ns, group) yield inst else: for group in account.list_groups(ns): yield group
def execute(self, ns, groups): if not groups: group_insts = account.list_groups(ns) else: group_insts = [] for group in groups: group_insts.append(account.get_group(ns, group)) for group in group_insts: users = account.get_users_in_group(ns, group) yield (group.Name, ', '.join([user.Name for user in users]))