Revision b6426ead snf-astakos-app/astakos/im/management/commands/reconcile-resources-astakos.py

b/snf-astakos-app/astakos/im/management/commands/reconcile-resources-astakos.py
34 34
from optparse import make_option
35 35
from datetime import datetime
36 36

  
37
from django.core.management.base import BaseCommand, CommandError
37
from django.core.management.base import CommandError
38 38
from django.db import transaction
39 39

  
40 40
from snf_django.utils import reconcile
......
44 44
from astakos.im.functions import count_pending_app
45 45
import astakos.quotaholder_app.callpoint as qh
46 46
import astakos.quotaholder_app.exception as qh_exception
47
from snf_django.management.commands import SynnefoCommand
47 48

  
48 49

  
49
class Command(BaseCommand):
50
class Command(SynnefoCommand):
50 51
    help = """Reconcile resource usage of Quotaholder with Astakos DB.
51 52

  
52 53
    Detect unsynchronized usage between Quotaholder and Astakos DB resources
......
54 55

  
55 56
    """
56 57

  
57
    option_list = BaseCommand.option_list + (
58
    option_list = SynnefoCommand.option_list + (
58 59
        make_option("--userid", dest="userid",
59 60
                    default=None,
60 61
                    help="Reconcile resources only for this user"),
......
78 79
        userid = options['userid']
79 80
        project = options['project']
80 81

  
81
        RESOURCES = [quotas.PENDING_APP_RESOURCE]
82
        resources = [quotas.PENDING_APP_RESOURCE]
82 83

  
83 84
        try:
84 85
            astakos = Component.objects.get(name="astakos")
......
109 110
            db_project_holdings.update(user_holdings)
110 111

  
111 112
        unsynced_users, users_pending, users_unknown =\
112
            reconcile.check_users(self.stderr, RESOURCES,
113
            reconcile.check_users(self.stderr, resources,
113 114
                                  db_holdings, qh_holdings)
114 115

  
115 116
        unsynced_projects, projects_pending, projects_unknown =\
116
            reconcile.check_projects(self.stderr, RESOURCES,
117
            reconcile.check_projects(self.stderr, resources,
117 118
                                     db_project_holdings, qh_project_holdings)
118 119
        pending_exists = users_pending or projects_pending
119 120
        unknown_exists = users_unknown or projects_unknown

Also available in: Unified diff