コード例 #1
0
    def quotas(self, sync, verify, user_ident, output_format, style):
        list_only = not sync and not verify

        if user_ident is not None:
            users = [self.get_user(user_ident)]
        else:
            users = AstakosUser.objects.verified()

        if list_only:
            qh_quotas, astakos_i = list_user_quotas(users)

            info = {}
            for user in users:
                info[user.uuid] = user.email

            print_data, labels = show_quotas(qh_quotas,
                                             astakos_i,
                                             info,
                                             style=style)
            utils.pprint_table(self.stdout, print_data, labels, output_format)

        elif verify or sync:
            qh_limits, diff_q = qh_sync_users_diffs(users, sync=sync)
            if verify:
                self.print_verify(qh_limits, diff_q)
            if sync:
                self.print_sync(diff_q)
コード例 #2
0
    def handle(self, *args, **options):
        sync = options['sync']
        user_ident = options['user']

        if user_ident is not None:
            users = [common.get_accepted_user(user_ident)]
        else:
            users = AstakosUser.objects.accepted()

        qh_limits, diff_q = qh_sync_users_diffs(users, sync=sync)
        if sync:
            self.print_sync(diff_q)
        else:
            self.print_verify(qh_limits, diff_q)
コード例 #3
0
ファイル: quota-verify.py プロジェクト: antonis-m/synnefo
    def handle(self, *args, **options):
        sync = options['sync']
        user_ident = options['user']

        if user_ident is not None:
            users = [common.get_accepted_user(user_ident)]
        else:
            users = AstakosUser.objects.accepted()

        qh_limits, diff_q = qh_sync_users_diffs(users, sync=sync)
        if sync:
            self.print_sync(diff_q)
        else:
            self.print_verify(qh_limits, diff_q)
コード例 #4
0
ファイル: quota.py プロジェクト: vkoukis/synnefo
    def quotas(self, sync, verify, user_ident, output_format, style):
        list_only = not sync and not verify

        if user_ident is not None:
            users = [self.get_user(user_ident)]
        else:
            users = AstakosUser.objects.accepted()

        if list_only:
            qh_quotas, astakos_i = list_user_quotas(users)

            info = {}
            for user in users:
                info[user.uuid] = user.email

            print_data, labels = show_quotas(qh_quotas, astakos_i, info, style=style)
            utils.pprint_table(self.stdout, print_data, labels, output_format)

        elif verify or sync:
            qh_limits, diff_q = qh_sync_users_diffs(users, sync=sync)
            if verify:
                self.print_verify(qh_limits, diff_q)
            if sync:
                self.print_sync(diff_q)