Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
7e98f782
Commit
7e98f782
authored
14 years ago
by
Iustin Pop
Browse files
Options
Downloads
Patches
Plain Diff
Rename the job status constants
The rename is done such that we match Ganeti's own constants.
parent
95f490de
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Ganeti/Jobs.hs
+24
-24
24 additions, 24 deletions
Ganeti/Jobs.hs
hbal.hs
+2
-2
2 additions, 2 deletions
hbal.hs
with
26 additions
and
26 deletions
Ganeti/Jobs.hs
+
24
−
24
View file @
7e98f782
...
...
@@ -33,33 +33,33 @@ import qualified Text.JSON as J
-- | The JobStatus data type. Note that this is ordered especially
-- such that greater\/lesser comparison on values of this type makes
-- sense.
data
JobStatus
=
J
obQueued
|
J
obWaitLock
|
J
obRunning
|
J
obSuccess
|
J
obCanceling
|
J
obCanceled
|
J
obError
|
J
obGone
data
JobStatus
=
J
OB_STATUS_QUEUED
|
J
OB_STATUS_WAITLOCK
|
J
OB_STATUS_RUNNING
|
J
OB_STATUS_SUCCESS
|
J
OB_STATUS_CANCELING
|
J
OB_STATUS_CANCELED
|
J
OB_STATUS_ERROR
|
J
OB_STATUS_GONE
deriving
(
Eq
,
Enum
,
Ord
,
Bounded
,
Show
)
instance
JSON
JobStatus
where
showJSON
js
=
showJSON
w
where
w
=
case
js
of
JobQueued
->
"queued"
JobWaitLock
->
"waiting"
JobCanceling
->
"canceling"
JobRunning
->
"running"
JobCanceled
->
"canceled"
JobSuccess
->
"success"
JobError
->
"error"
JobGone
->
"gone"
-- Fake status
JOB_STATUS_QUEUED
->
"queued"
JOB_STATUS_WAITLOCK
->
"waiting"
JOB_STATUS_CANCELING
->
"canceling"
JOB_STATUS_RUNNING
->
"running"
JOB_STATUS_CANCELED
->
"canceled"
JOB_STATUS_SUCCESS
->
"success"
JOB_STATUS_ERROR
->
"error"
JOB_STATUS_GONE
->
"gone"
-- Fake status
readJSON
s
=
case
readJSON
s
of
J
.
Ok
"queued"
->
J
.
Ok
J
obQueued
J
.
Ok
"waiting"
->
J
.
Ok
J
obWaitLock
J
.
Ok
"canceling"
->
J
.
Ok
J
obCanceling
J
.
Ok
"running"
->
J
.
Ok
J
obRunning
J
.
Ok
"success"
->
J
.
Ok
J
obSuccess
J
.
Ok
"canceled"
->
J
.
Ok
J
obCanceled
J
.
Ok
"error"
->
J
.
Ok
J
obError
_
->
J
.
Error
(
"Unknown job status "
++
show
s
)
J
.
Ok
"queued"
->
J
.
Ok
J
OB_STATUS_QUEUED
J
.
Ok
"waiting"
->
J
.
Ok
J
OB_STATUS_WAITLOCK
J
.
Ok
"canceling"
->
J
.
Ok
J
OB_STATUS_CANCELING
J
.
Ok
"running"
->
J
.
Ok
J
OB_STATUS_RUNNING
J
.
Ok
"success"
->
J
.
Ok
J
OB_STATUS_SUCCESS
J
.
Ok
"canceled"
->
J
.
Ok
J
OB_STATUS_CANCELED
J
.
Ok
"error"
->
J
.
Ok
J
OB_STATUS_ERROR
_
->
J
.
Error
(
"Unknown job status "
++
show
s
)
This diff is collapsed.
Click to expand it.
hbal.hs
+
2
−
2
View file @
7e98f782
...
...
@@ -131,7 +131,7 @@ waitForJobs client jids = do
sts
<-
L
.
queryJobsStatus
client
jids
case
sts
of
Bad
x
->
return
$
Bad
x
Ok
s
->
if
any
(
<=
J
obRunning
)
s
Ok
s
->
if
any
(
<=
J
OB_STATUS_RUNNING
)
s
then
do
-- TODO: replace hardcoded value with a better thing
threadDelay
(
1000000
*
15
)
...
...
@@ -140,7 +140,7 @@ waitForJobs client jids = do
-- | Check that a set of job statuses is all success
checkJobsStatus
::
[
JobStatus
]
->
Bool
checkJobsStatus
=
all
(
==
J
obSuccess
)
checkJobsStatus
=
all
(
==
J
OB_STATUS_SUCCESS
)
-- | Execute an entire jobset
execJobSet
::
String
->
Node
.
List
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment