Revision 5227de56 htools/Ganeti/Query/Node.hs
b/htools/Ganeti/Query/Node.hs | ||
---|---|---|
117 | 117 |
"\"" ++ nodeRoleToRaw role ++ "\" for " ++ roleDescription role) |
118 | 118 |
(reverse [minBound..maxBound])) |
119 | 119 |
|
120 |
-- | Get node powered status. |
|
121 |
getNodePower :: ConfigData -> Node -> ResultEntry |
|
122 |
getNodePower cfg node = |
|
123 |
case getNodeNdParams cfg node of |
|
124 |
Nothing -> rsNoData |
|
125 |
Just ndp -> if null (ndpOobProgram ndp) |
|
126 |
then rsUnavail |
|
127 |
else rsNormal (nodePowered node) |
|
128 |
|
|
120 | 129 |
-- | List of all node fields. |
121 | 130 |
nodeFields :: FieldList Node NodeRuntime |
122 | 131 |
nodeFields = |
... | ... | |
174 | 183 |
getNodeInstances cfg . nodeName)) |
175 | 184 |
, (FieldDefinition "role" "Role" QFTText nodeRoleDoc, |
176 | 185 |
FieldConfig ((rsNormal .) . getNodeRole)) |
177 |
-- FIXME: the powered state is special (has an different context, |
|
178 |
-- not runtime) in Python |
|
179 | 186 |
, (FieldDefinition "powered" "Powered" QFTBool |
180 | 187 |
"Whether node is thought to be powered on", |
181 |
missingRuntime)
|
|
188 |
FieldConfig getNodePower)
|
|
182 | 189 |
-- FIXME: the two fields below are incomplete in Python, part of the |
183 | 190 |
-- non-implemented node resource model; they are declared just for |
184 | 191 |
-- parity, but are not functional |
Also available in: Unified diff