From 7b6e99b3db854b60ea1a82913e1a615c0ad4c992 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Tue, 21 Dec 2010 11:09:54 +0100 Subject: [PATCH] Add a new type ClusterData This will be used to hold all the disparate uses of the cluster data: we have either tuples with these four elements, or functions taking these four arguments, etc. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Balazs Lecz <leczb@google.com> --- Ganeti/HTools/Loader.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Ganeti/HTools/Loader.hs b/Ganeti/HTools/Loader.hs index b7c74a0f8..81ccbfee9 100644 --- a/Ganeti/HTools/Loader.hs +++ b/Ganeti/HTools/Loader.hs @@ -36,6 +36,8 @@ module Ganeti.HTools.Loader , commonSuffix , RqType(..) , Request(..) + , ClusterData(..) + , emptyCluster ) where import Data.List @@ -74,6 +76,18 @@ data RqType data Request = Request RqType Group.List Node.List Instance.List [String] deriving (Show) +-- | The cluster state. +data ClusterData = ClusterData + { cdGroups :: Group.List -- ^ The node group list + , cdNodes :: Node.List -- ^ The node list + , cdInstances :: Instance.List -- ^ The instance list + , cdTags :: [String] -- ^ The cluster tags + } deriving (Show) + +-- | An empty cluster. +emptyCluster :: ClusterData +emptyCluster = ClusterData Container.empty Container.empty Container.empty [] + -- * Functions -- | Lookups a node into an assoc list. -- GitLab