Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
a2f9842d
Commit
a2f9842d
authored
Nov 23, 2013
by
Christos Stavrakakis
Browse files
cyclades: Remove duplicate constants
parent
b6cd68a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/logic/reconciliation.py
View file @
a2f9842d
...
...
@@ -69,17 +69,13 @@ from synnefo.db.models import (Backend, VirtualMachine, Flavor,
BackendNetwork
,
BridgePoolTable
,
MacPrefixPoolTable
)
from
synnefo.db
import
pools
from
synnefo.logic
import
utils
,
backend
as
backend_mod
from
synnefo.logic
import
utils
,
rapi
,
backend
as
backend_mod
logger
=
logging
.
getLogger
()
logging
.
basicConfig
()
BUILDING_NIC_TIMEOUT
=
timedelta
(
seconds
=
120
)
GANETI_JOB_ERROR
=
"error"
GANETI_JOBS_PENDING
=
[
"queued"
,
"waiting"
,
"running"
,
"canceling"
]
GANETI_JOBS_FINALIZED
=
[
"success"
,
"error"
,
"canceled"
]
class
BackendReconciler
(
object
):
def
__init__
(
self
,
backend
,
logger
,
options
=
None
):
...
...
@@ -122,9 +118,9 @@ class BackendReconciler(object):
job_id
=
db_server
.
backendjobid
if
job_id
in
self
.
gnt_jobs
:
gnt_job_status
=
self
.
gnt_jobs
[
job_id
][
"status"
]
if
gnt_job_status
==
GANETI_JOB
_ERROR
:
if
gnt_job_status
==
rapi
.
JOB_STATUS
_ERROR
:
return
"ERROR"
elif
gnt_job_status
not
in
GANETI_JOB
S_FINALIZED
:
elif
gnt_job_status
not
in
rapi
.
JOB_STATU
S_FINALIZED
:
return
"RUNNING"
else
:
return
"FINALIZED"
...
...
@@ -319,7 +315,7 @@ class BackendReconciler(object):
pending_task
=
True
else
:
gnt_job_status
=
self
.
gnt_jobs
[
job_id
][
"status"
]
if
gnt_job_status
in
GANETI_JOB
S_FINALIZED
:
if
gnt_job_status
in
rapi
.
JOB_STATU
S_FINALIZED
:
pending_task
=
True
if
pending_task
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment