Commit 3667467d authored by Iustin Pop's avatar Iustin Pop
Browse files

htools: remove pre-2.4 compatibility from RAPI



This was potentially hiding issues in the group query, so let's remove
it since we're now bound to the current Ganeti version.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 1fe412bb
......@@ -97,12 +97,6 @@ getGroups :: String -> Result [(String, Group.Group)]
getGroups body = loadJSArray "Parsing group data" body >>=
mapM (parseGroup . fromJSObject)
-- | Generates a fake group list.
getFakeGroups :: Result [(String, Group.Group)]
getFakeGroups =
return [(defaultGroupID,
Group.create "default" defaultGroupID AllocPreferred)]
-- | Construct an instance from a JSON object.
parseInstance :: NameAssoc
-> JSRecord
......@@ -178,12 +172,7 @@ readData master = do
parseData :: (Result String, Result String, Result String, Result String)
-> Result ClusterData
parseData (group_body, node_body, inst_body, tags_body) = do
group_data <-
-- TODO: handle different ganeti versions properly, not via "all
-- errors mean Ganeti 2.3"
case group_body of
Bad _ -> getFakeGroups
Ok v -> getGroups v
group_data <- group_body >>= getGroups
let (group_names, group_idx) = assignIndices group_data
node_data <- node_body >>= getNodes group_names
let (node_names, node_idx) = assignIndices node_data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment