Exemplo n.º 1
0
    def __call__(self, args):
        if args.all:
            kwargs = {'list_all':True}
        elif args.user:
            kwargs = {'user':args.user}
        else:
            kwargs = {}

        groups = []
        full_output = False

        try:
            if args.group:
                groups.append(self.get_repoman_client(args).describe_group(args.group))
                full_output = True
            else:
                groups_urls = self.get_repoman_client(args).list_groups(**kwargs)
                # Fetch metadata for each group.
                # TODO: Create a server method that will return the metadata
                # of all groups and use that instead. (Andre)
                for group_url in groups_urls:
                    groups.append(self.get_repoman_client(args).describe_group(group_url.rsplit('/',1)[-1]))

            display.display_group_list(groups, short_output=args.short, full_output=full_output)
        except RepomanError, e:
            raise SubcommandFailure(self, 'Error listing group(s).', e)
Exemplo n.º 2
0
    def __call__(self, args, extra_args=None):
        repo = RepomanClient(config.host, config.port, config.proxy)
        if args.all:
            kwargs = {'list_all':True}
        elif args.user:
            kwargs = {'user':args.user}
        else:
            kwargs = {}

        try:
            groups = repo.list_groups(**kwargs)
            display.display_group_list(groups, long=args.long)
        except RepomanError, e:
            print e.message
            sys.exit(1)
Exemplo n.º 3
0
    def __call__(self, args, extra_args=None):
        log = logging.getLogger('ListGroups')
        log.debug("args: '%s' extra_args: '%s'" % (args, extra_args))
    
        repo = RepomanClient(config.host, config.port, config.proxy)
        if args.all:
            kwargs = {'list_all':True}
        elif args.user:
            kwargs = {'user':args.user}
        else:
            kwargs = {}

        log.debug("kwargs: '%s'" % kwargs)

        try:
            groups = repo.list_groups(**kwargs)
            display.display_group_list(groups, long=args.long)
        except RepomanError, e:
            print e.message
            sys.exit(1)
Exemplo n.º 4
0
    def __call__(self, args, extra_args=None):
        log = logging.getLogger('ListGroups')
        log.debug("args: '%s' extra_args: '%s'" % (args, extra_args))

        repo = RepomanClient(config.host, config.port, config.proxy)
        if args.all:
            kwargs = {'list_all': True}
        elif args.user:
            kwargs = {'user': args.user}
        else:
            kwargs = {}

        log.debug("kwargs: '%s'" % kwargs)

        try:
            groups = repo.list_groups(**kwargs)
            display.display_group_list(groups, long=args.long)
        except RepomanError, e:
            print e.message
            sys.exit(1)