import qualified Ganeti.HTools.Node as Node
import qualified Ganeti.HTools.Instance as Instance
+-- | Serialize a single group
+serializeGroup :: Group.Group -> String
+serializeGroup grp =
+ printf "%s|%s" (Group.name grp) (Group.uuid grp)
+
+-- | Generate group file data from a group list
+serializeGroups :: Group.List -> String
+serializeGroups = unlines . map serializeGroup . Container.elems
+
-- | Serialize a single node
serializeNode :: Group.List -> Node.Node -> String
serializeNode gl node =
-- | Generate complete cluster data from node and instance lists
serializeCluster :: Group.List -> Node.List -> Instance.List -> String
serializeCluster gl nl il =
- let ndata = serializeNodes gl nl
+ let gdata = serializeGroups gl
+ ndata = serializeNodes gl nl
idata = serializeInstances nl il
- in ndata ++ ['\n'] ++ idata
+ in gdata ++ ['\n'] ++ ndata ++ ['\n'] ++ idata
-- | Load a group from a field list.
loadGroup :: (Monad m) => [String] -> m (String, Group.Group)
#!/bin/bash
-# Copyright (C) 2009 Google Inc.
+# Copyright (C) 2009, 2010 Google Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
echo Comparing hscan results...
diff -u $T/$RAPI.data $T/LOCAL.data
-FN=$(head -n1 $T/$RAPI.data|cut -d \| -f1)
+FN=$($CLUSTER head -n1 /var/lib/ganeti/ssconf_node_list)
FI=$($CLUSTER head -n1 /var/lib/ganeti/ssconf_instance_list)