Revision a0be8f1a src/Ganeti/HTools/Backend/Text.hs

b/src/Ganeti/HTools/Backend/Text.hs
69 69
-- | Serialize a single group.
70 70
serializeGroup :: Group.Group -> String
71 71
serializeGroup grp =
72
  printf "%s|%s|%s|%s" (Group.name grp) (Group.uuid grp)
72
  printf "%s|%s|%s|%s|%s" (Group.name grp) (Group.uuid grp)
73 73
           (allocPolicyToRaw (Group.allocPolicy grp))
74 74
           (intercalate "," (Group.allTags grp))
75
           (intercalate "," (Group.networks grp))
75 76

  
76 77
-- | Generate group file data from a group list.
77 78
serializeGroups :: Group.List -> String
......
182 183
loadGroup :: (Monad m) => [String]
183 184
          -> m (String, Group.Group) -- ^ The result, a tuple of group
184 185
                                     -- UUID and group object
185
loadGroup [name, gid, apol, tags] = do
186
loadGroup [name, gid, apol, tags, nets] = do
186 187
  xapol <- allocPolicyFromRaw apol
187 188
  let xtags = commaSplit tags
188
  -- TODO: parse networks to which this group is connected
189
  return (gid, Group.create name gid xapol [] defIPolicy xtags)
190

  
189
  let xnets = commaSplit nets
190
  return (gid, Group.create name gid xapol xnets defIPolicy xtags)
191
loadGroup [name, gid, apol, tags] = loadGroup [name, gid, apol, tags, ""]
191 192
loadGroup s = fail $ "Invalid/incomplete group data: '" ++ show s ++ "'"
192 193

  
193 194
-- | Load a node from a field list.

Also available in: Unified diff