コード例 #1
0
    def handle(self, *args, **options):
        fix = options["fix"]

        accepted, rejected = quotas.resolve_pending_commissions()

        if accepted:
            self.stdout.write("Pending accepted commissions:\n %s\n" % list_to_string(accepted))

        if rejected:
            self.stdout.write("Pending rejected commissions:\n %s\n" % list_to_string(rejected))

        if fix and (accepted or rejected):
            self.stdout.write("Fixing pending commissions..\n")
            quotas.reconcile_resolve_commissions(accept=accepted, reject=rejected, strict=False)
コード例 #2
0
    def handle(self, *args, **options):
        fix = options['fix']

        accepted, rejected = quotas.resolve_pending_commissions()

        if accepted:
            self.stdout.write("Pending accepted commissions:\n %s\n" %
                              list_to_string(accepted))

        if rejected:
            self.stdout.write("Pending rejected commissions:\n %s\n" %
                              list_to_string(rejected))

        if fix and (accepted or rejected):
            self.stdout.write("Fixing pending commissions..\n")
            quotas.reconcile_resolve_commissions(accept=accepted,
                                                 reject=rejected,
                                                 strict=False)
コード例 #3
0
ファイル: tests.py プロジェクト: AthinaB/synnefo
 def test_1(self, qh):
     qh.return_value = [21, 25, 28]
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([25], [28, 21]))
コード例 #4
0
ファイル: tests.py プロジェクト: AthinaB/synnefo
 def test_no_pending(self, qh):
     qh.return_value = []
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([], []))
コード例 #5
0
ファイル: tests.py プロジェクト: kins299/mycloud
 def test_1(self, qh):
     qh.return_value = [21, 25, 28]
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([25], [28, 21]))
コード例 #6
0
ファイル: tests.py プロジェクト: kins299/mycloud
 def test_no_pending(self, qh):
     qh.return_value = []
     pending = quotas.resolve_pending_commissions()
     self.assertEqual(pending, ([], []))