Actually, I just realized that we don't want to change interfaces on 2.15, as it was already released as stable. This GSoC project will be worked on 2.17/18 anyway, so I cherrypicked your patch into 2.17 as b49705d73ca7272ac6c4aab713ee1d723e83a69b and reverted the original in 2.15. Sorry about the confusion.
On Monday, April 4, 2016 at 11:57:43 AM UTC+1, Viktor Bachraty wrote: > > Hi Daniil! > > Don't worry, your patch is already in branch 2.15 (as your email was > suggesting): > http://git.ganeti.org/?p=ganeti.git;a=commit;h=9d9ccdd66c6d6d725dc6195c47e65f3659c568d0 > Maybe later this week we will merge it upwards to 2.18. > > Viktor > > On Monday, April 4, 2016 at 11:45:04 AM UTC+1, Даниил Лещёв wrote: >> >> Hi, Viktor! >> >> I actually don't want to be annoying, but I still can't see my patch at >> git.ganeti.org. >> It's very important for me, because I want to take part in GSoC 2016. >> Hope, I don't take much of your time. >> >> LGTM. Thanks! I will push this patch later today. >>> >>> On Tuesday, March 29, 2016 at 5:50:58 PM UTC+1, Даниил Лещёв wrote: >>>> >>>> From: Daniil Leshchev <[email protected]> >>>> >>>> In accordance with issue #475: >>>> Implement extraction of 'networks' field in Rapi and Luxi backends. >>>> Add 'networks' field into Group query object. >>>> >>>> Signed-off-by: Daniil Leshchev <[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, 12 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/lib/query.py b/lib/query.py >>>> index 43d8fad..222c14f 100644 >>>> --- a/lib/query.py >>>> +++ b/lib/query.py >>>> @@ -2448,6 +2448,9 @@ 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 5a3cb1d..2ac71e6 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"] >>>> + ["uuid", "name", "alloc_policy", "ipolicy", "tags", "networks"] >>>> 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] = do >>>> +parseGroup [uuid, name, apol, ipol, tags, nets] = 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 >>>> - -- TODO: parse networks to which this group is connected >>>> - return (xuuid, Group.create xname xuuid xapol [] xipol xtags) >>>> + xnets <- convert "networks" nets >>>> + return (xuuid, Group.create xname xuuid xapol xnets 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 df93d6a..ce1bb10 100644 >>>> --- a/src/Ganeti/HTools/Backend/Rapi.hs >>>> +++ b/src/Ganeti/HTools/Backend/Rapi.hs >>>> @@ -196,12 +196,13 @@ 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" >>>> - -- TODO: parse networks to which this group is connected >>>> - return (uuid, Group.create name uuid apol [] ipol tags) >>>> + nets <- extractDef "networks" [] >>>> + return (uuid, Group.create name uuid apol nets 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 45bd81a..4989788 100644 >>>> --- a/src/Ganeti/Query/Group.hs >>>> +++ b/src/Ganeti/Query/Group.hs >>>> @@ -55,6 +55,8 @@ 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) >>>> -- >>>> 1.9.1 >>>> >>>>
