[Pkg-ganeti-devel] [ganeti] 33/165: Export formatAllocate from IAlloc backend
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Tue Aug 11 13:53:10 UTC 2015
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository ganeti.
commit f73ddcdcc4fff6432c015f1d658a0fb43092326c
Author: Klaus Aehlig <aehlig at google.com>
Date: Tue Jan 27 14:20:03 2015 +0100
Export formatAllocate from IAlloc backend
...so that other strategies can also report IAllocation results.
Also, generalize to GenericAllocSolution
Signed-off-by: Klaus Aehlig <aehlig at google.com>
Reviewed-by: Petr Pudlak <pudlak at google.com>
---
src/Ganeti/HTools/Backend/IAlloc.hs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/Ganeti/HTools/Backend/IAlloc.hs b/src/Ganeti/HTools/Backend/IAlloc.hs
index 6a0f463..f19e522 100644
--- a/src/Ganeti/HTools/Backend/IAlloc.hs
+++ b/src/Ganeti/HTools/Backend/IAlloc.hs
@@ -37,6 +37,7 @@ module Ganeti.HTools.Backend.IAlloc
, runIAllocator
, processRelocate
, loadData
+ , formatAllocate
) where
import Data.Either ()
@@ -283,11 +284,13 @@ formatResponse success info result =
in encodeStrict $ makeObj [e_success, e_info, e_result]
-- | Flatten the log of a solution into a string.
-describeSolution :: Cluster.AllocSolution -> String
+describeSolution :: Cluster.GenericAllocSolution a -> String
describeSolution = intercalate ", " . Cluster.asLog
-- | Convert allocation/relocation results into the result format.
-formatAllocate :: Instance.List -> Cluster.AllocSolution -> Result IAllocResult
+formatAllocate :: Instance.List
+ -> Cluster.GenericAllocSolution a
+ -> Result IAllocResult
formatAllocate il as = do
let info = describeSolution as
case Cluster.asSolution as of
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git
More information about the Pkg-ganeti-devel
mailing list