Prevent allocation on unallocable node groups
[ganeti-local] / hail.hs
diff --git a/hail.hs b/hail.hs
index ed67005..541e1a9 100644 (file)
--- a/hail.hs
+++ b/hail.hs
@@ -4,7 +4,7 @@
 
 {-
 
-Copyright (C) 2009, 2010 Google Inc.
+Copyright (C) 2009, 2010, 2011 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
@@ -71,8 +71,9 @@ processRequest request =
   let Request rqtype (ClusterData gl nl il _) = request
   in case rqtype of
        Allocate xi reqn -> Cluster.tryMGAlloc gl nl il xi reqn
-       Relocate idx reqn exnodes -> Cluster.tryReloc nl il idx reqn exnodes
-       Evacuate exnodes -> Cluster.tryEvac nl il exnodes
+       Relocate idx reqn exnodes -> Cluster.tryMGReloc gl nl il
+                                    idx reqn exnodes
+       Evacuate exnodes -> Cluster.tryMGEvac gl nl il exnodes
 
 -- | Reads the request from the data file(s)
 readRequest :: Options -> [String] -> IO Request
@@ -89,9 +90,9 @@ readRequest opts args = do
           Ok rq -> return rq
   r2 <- if isJust (optDataFile opts) ||  (not . null . optNodeSim) opts
         then  do
-          (gl, nl, il, ctags) <- loadExternalData opts
+          cdata <- loadExternalData opts
           let Request rqt _ = r1
-          return $ Request rqt (ClusterData gl nl il ctags)
+          return $ Request rqt cdata
         else return r1
   return r2