Revision a813a251 snf-cyclades-app/synnefo/logic/reconciliation.py

b/snf-cyclades-app/synnefo/logic/reconciliation.py
59 59
import logging
60 60
import sys
61 61
import itertools
62

  
63
from django.core.management import setup_environ
64
try:
65
    from synnefo import settings
66
except ImportError:
67
    raise Exception("Cannot import settings, make sure PYTHONPATH contains "
68
                    "the parent directory of the Synnefo Django project.")
69
setup_environ(settings)
70

  
71

  
72 62
from datetime import datetime, timedelta
73 63

  
74 64
from synnefo.db.models import (VirtualMachine, pooled_rapi_client)
75 65
from synnefo.logic.rapi import GanetiApiError
76 66
from synnefo.logic.backend import get_ganeti_instances, get_backends
77 67
from synnefo.logic import utils
68
from django.conf import settings
78 69

  
79 70

  
80 71
log = logging.getLogger()
......
338 329
        if group_list != groups:
339 330
            hanging[id] = groups - group_list
340 331
    return hanging
341

  
342

  
343
# Only for testing this module individually
344
def main():
345
    print get_instances_from_ganeti()
346

  
347

  
348
if __name__ == "__main__":
349
    sys.exit(main())

Also available in: Unified diff