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
9d775204
Commit
9d775204
authored
14 years ago
by
Iustin Pop
Browse files
Options
Downloads
Patches
Plain Diff
Ignore nodes which are not vm_capable
This break compatibility with Ganeti pre-2.3.
parent
92d43268
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ganeti/HTools/Luxi.hs
+5
-4
5 additions, 4 deletions
Ganeti/HTools/Luxi.hs
with
5 additions
and
4 deletions
Ganeti/HTools/Luxi.hs
+
5
−
4
View file @
9d775204
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
{-
{-
Copyright (C) 2009 Google Inc.
Copyright (C) 2009
, 2010
Google Inc.
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
@@ -53,7 +53,7 @@ toArray v =
...
@@ -53,7 +53,7 @@ toArray v =
queryNodesMsg
::
L
.
LuxiOp
queryNodesMsg
::
L
.
LuxiOp
queryNodesMsg
=
queryNodesMsg
=
L
.
QueryNodes
[]
[
"name"
,
"mtotal"
,
"mnode"
,
"mfree"
,
"dtotal"
,
"dfree"
,
L
.
QueryNodes
[]
[
"name"
,
"mtotal"
,
"mnode"
,
"mfree"
,
"dtotal"
,
"dfree"
,
"ctotal"
,
"offline"
,
"drained"
]
False
"ctotal"
,
"offline"
,
"drained"
,
"vm_capable"
]
False
-- | The input data for instance query.
-- | The input data for instance query.
queryInstancesMsg
::
L
.
LuxiOp
queryInstancesMsg
::
L
.
LuxiOp
...
@@ -114,13 +114,14 @@ getNodes arr = toArray arr >>= mapM parseNode
...
@@ -114,13 +114,14 @@ getNodes arr = toArray arr >>= mapM parseNode
-- | Construct a node from a JSON object.
-- | Construct a node from a JSON object.
parseNode
::
JSValue
->
Result
(
String
,
Node
.
Node
)
parseNode
::
JSValue
->
Result
(
String
,
Node
.
Node
)
parseNode
(
JSArray
[
name
,
mtotal
,
mnode
,
mfree
,
dtotal
,
dfree
parseNode
(
JSArray
[
name
,
mtotal
,
mnode
,
mfree
,
dtotal
,
dfree
,
ctotal
,
offline
,
drained
])
,
ctotal
,
offline
,
drained
,
vm_capable
])
=
do
=
do
xname
<-
annotateResult
"Parsing new node"
(
fromJVal
name
)
xname
<-
annotateResult
"Parsing new node"
(
fromJVal
name
)
let
convert
v
=
annotateResult
(
"Node '"
++
xname
++
"'"
)
(
fromJVal
v
)
let
convert
v
=
annotateResult
(
"Node '"
++
xname
++
"'"
)
(
fromJVal
v
)
xoffline
<-
convert
offline
xoffline
<-
convert
offline
xdrained
<-
convert
drained
xdrained
<-
convert
drained
node
<-
(
if
xoffline
||
xdrained
xvm_capable
<-
convert
vm_capable
node
<-
(
if
xoffline
||
xdrained
||
not
xvm_capable
then
return
$
Node
.
create
xname
0
0
0
0
0
0
True
then
return
$
Node
.
create
xname
0
0
0
0
0
0
True
else
do
else
do
xmtotal
<-
convert
mtotal
xmtotal
<-
convert
mtotal
...
...
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