Commit da1dcce1 authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Make node groups' networks field a dict of nicparams



The networks field of the node groups class is a dictionary
of nic params and not a list of networks. This should fix
the broken QA.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent e7e2552e
......@@ -364,7 +364,10 @@ genNodeGroup = do
ipolicy <- arbitrary
diskparams <- pure (GenericContainer Map.empty)
num_networks <- choose (0, 3)
networks <- vectorOf num_networks genValidNetwork
net_uuid_list <- vectorOf num_networks (arbitrary::Gen String)
nic_param_list <- vectorOf num_networks (arbitrary::Gen PartialNic)
net_map <- pure (GenericContainer . Map.fromList $
zip net_uuid_list nic_param_list)
-- timestamp fields
ctime <- arbitrary
mtime <- arbitrary
......@@ -372,7 +375,7 @@ genNodeGroup = do
serial <- arbitrary
tags <- Set.fromList <$> genTags
let group = NodeGroup name members ndparams alloc_policy ipolicy diskparams
networks ctime mtime uuid serial tags
net_map ctime mtime uuid serial tags
return group
instance Arbitrary NodeGroup where
......
......@@ -501,6 +501,9 @@ instance TagsObject Node where
-- | The disk parameters type.
type DiskParams = Container (Container JSValue)
-- | A mapping from network UUIDs to nic params of the networks.
type Networks = Container PartialNic
$(buildObject "NodeGroup" "group" $
[ simpleField "name" [t| String |]
, defaultField [| [] |] $ simpleField "members" [t| [String] |]
......@@ -508,7 +511,7 @@ $(buildObject "NodeGroup" "group" $
, simpleField "alloc_policy" [t| AllocPolicy |]
, simpleField "ipolicy" [t| PartialIPolicy |]
, simpleField "diskparams" [t| DiskParams |]
, defaultField [| [] |] $ simpleField "networks" [t| [Network] |]
, simpleField "networks" [t| Networks |]
]
++ timeStampFields
++ uuidFields
......
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