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

b/snf-cyclades-app/synnefo/logic/reconciliation.py
69 69
                               BackendNetwork, BridgePoolTable,
70 70
                               MacPrefixPoolTable)
71 71
from synnefo.db import pools
72
from synnefo.logic import utils, backend as backend_mod
72
from synnefo.logic import utils, rapi, backend as backend_mod
73 73

  
74 74
logger = logging.getLogger()
75 75
logging.basicConfig()
76 76

  
77 77
BUILDING_NIC_TIMEOUT = timedelta(seconds=120)
78 78

  
79
GANETI_JOB_ERROR = "error"
80
GANETI_JOBS_PENDING = ["queued", "waiting", "running", "canceling"]
81
GANETI_JOBS_FINALIZED = ["success", "error", "canceled"]
82

  
83 79

  
84 80
class BackendReconciler(object):
85 81
    def __init__(self, backend, logger, options=None):
......
122 118
        job_id = db_server.backendjobid
123 119
        if job_id in self.gnt_jobs:
124 120
            gnt_job_status = self.gnt_jobs[job_id]["status"]
125
            if gnt_job_status == GANETI_JOB_ERROR:
121
            if gnt_job_status == rapi.JOB_STATUS_ERROR:
126 122
                return "ERROR"
127
            elif gnt_job_status not in GANETI_JOBS_FINALIZED:
123
            elif gnt_job_status not in rapi.JOB_STATUS_FINALIZED:
128 124
                return "RUNNING"
129 125
            else:
130 126
                return "FINALIZED"
......
319 315
            pending_task = True
320 316
        else:
321 317
            gnt_job_status = self.gnt_jobs[job_id]["status"]
322
            if gnt_job_status in GANETI_JOBS_FINALIZED:
318
            if gnt_job_status in rapi.JOB_STATUS_FINALIZED:
323 319
                pending_task = True
324 320

  
325 321
        if pending_task:

Also available in: Unified diff