This reverts commit 9d9ccdd66c6d6d725dc6195c47e65f3659c568d0. The
original commit introduces a new field in NodeGroup queries. This would
make parseGroup fail in case we'd run hbal querying for this new field
against an unchanged Luxi. As 2.15 was released as stable, we don't want
to break interfaces. The commit was cherrypicked into 2.17 as commit
b49705d73ca7272ac6c4aab713ee1d723e83a69b.

Signed-off-by: Viktor Bachraty <[email protected]>
---
 lib/query.py                      | 3 ---
 src/Ganeti/HTools/Backend/Luxi.hs | 8 ++++----
 src/Ganeti/HTools/Backend/Rapi.hs | 5 ++---
 src/Ganeti/Query/Group.hs         | 2 --
 4 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/lib/query.py b/lib/query.py
index 222c14f..43d8fad 100644
--- a/lib/query.py
+++ b/lib/query.py
@@ -2448,9 +2448,6 @@ def _BuildGroupFields():
     (_MakeField("ipolicy", "InstancePolicy", QFT_OTHER,
                 "Instance policy limitations (merged)"),
      GQ_CONFIG, 0, lambda ctx, _: ctx.group_ipolicy),
-    (_MakeField("networks", "Networks", QFT_OTHER,
-                "Node group networks"),
-     GQ_CONFIG, 0, _GetItemAttr("networks")),
     (_MakeField("custom_ipolicy", "CustomInstancePolicy", QFT_OTHER,
                 "Custom instance policy limitations"),
      GQ_CONFIG, 0, _GetItemAttr("ipolicy")),
diff --git a/src/Ganeti/HTools/Backend/Luxi.hs 
b/src/Ganeti/HTools/Backend/Luxi.hs
index 2ac71e6..5a3cb1d 100644
--- a/src/Ganeti/HTools/Backend/Luxi.hs
+++ b/src/Ganeti/HTools/Backend/Luxi.hs
@@ -149,7 +149,7 @@ queryClusterInfoMsg = L.QueryClusterInfo
 queryGroupsMsg :: L.LuxiOp
 queryGroupsMsg =
   L.Query (Qlang.ItemTypeOpCode Qlang.QRGroup)
-     ["uuid", "name", "alloc_policy", "ipolicy", "tags", "networks"]
+     ["uuid", "name", "alloc_policy", "ipolicy", "tags"]
      Qlang.EmptyFilter
 
 -- | Wraper over 'callMethod' doing node query.
@@ -276,15 +276,15 @@ getGroups jsv = extractArray jsv >>= mapM parseGroup
 
 -- | Parses a given group information.
 parseGroup :: [(JSValue, JSValue)] -> Result (String, Group.Group)
-parseGroup [uuid, name, apol, ipol, tags, nets] = do
+parseGroup [uuid, name, apol, ipol, tags] = do
   xname <- annotateResult "Parsing new group" (fromJValWithStatus name)
   let convert a = genericConvert "Group" xname a
   xuuid <- convert "uuid" uuid
   xapol <- convert "alloc_policy" apol
   xipol <- convert "ipolicy" ipol
   xtags <- convert "tags" tags
-  xnets <- convert "networks" nets
-  return (xuuid, Group.create xname xuuid xapol xnets xipol xtags)
+  -- TODO: parse networks to which this group is connected
+  return (xuuid, Group.create xname xuuid xapol [] xipol xtags)
 
 parseGroup v = fail ("Invalid group query result: " ++ show v)
 
diff --git a/src/Ganeti/HTools/Backend/Rapi.hs 
b/src/Ganeti/HTools/Backend/Rapi.hs
index ce1bb10..df93d6a 100644
--- a/src/Ganeti/HTools/Backend/Rapi.hs
+++ b/src/Ganeti/HTools/Backend/Rapi.hs
@@ -196,13 +196,12 @@ parseGroup :: JSRecord -> Result (String, Group.Group)
 parseGroup a = do
   name <- tryFromObj "Parsing new group" a "name"
   let extract s = tryFromObj ("Group '" ++ name ++ "'") a s
-  let extractDef s d = fromObjWithDefault a s d
   uuid <- extract "uuid"
   apol <- extract "alloc_policy"
   ipol <- extract "ipolicy"
   tags <- extract "tags"
-  nets <- extractDef "networks" []
-  return (uuid, Group.create name uuid apol nets ipol tags)
+  -- TODO: parse networks to which this group is connected
+  return (uuid, Group.create name uuid apol [] ipol tags)
 
 -- | Parse cluster data from the info resource.
 parseCluster :: JSObject JSValue -> Result ([String], IPolicy, String)
diff --git a/src/Ganeti/Query/Group.hs b/src/Ganeti/Query/Group.hs
index 4989788..45bd81a 100644
--- a/src/Ganeti/Query/Group.hs
+++ b/src/Ganeti/Query/Group.hs
@@ -55,8 +55,6 @@ groupFields =
   , (FieldDefinition "custom_ipolicy" "CustomInstancePolicy" QFTOther
        "Custom instance policy limitations",
      FieldSimple (rsNormal . groupIpolicy), QffNormal)
-  , (FieldDefinition "networks" "Networks" QFTOther "Node group networks",
-     FieldSimple (rsNormal . groupNetworks), QffNormal)
   , (FieldDefinition "custom_ndparams" "CustomNDParams" QFTOther
        "Custom node parameters",
      FieldSimple (rsNormal . groupNdparams), QffNormal)
-- 
2.8.0.rc3.226.g39d4020

Reply via email to