예제 #1
0
파일: master.py 프로젝트: ceache/treadmill
    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))
예제 #2
0
        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'])