Commit 5850e990 authored by Iustin Pop's avatar Iustin Pop
Browse files

htools: Fix some compiler warnings


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 9915fb20
...@@ -1260,8 +1260,8 @@ computeMoves i inam mv c d = ...@@ -1260,8 +1260,8 @@ computeMoves i inam mv c d =
ReplacePrimary _ -> (printf "f r:%s f" c, [mig, rep c, mig]) ReplacePrimary _ -> (printf "f r:%s f" c, [mig, rep c, mig])
where morf = if Instance.isRunning i then "migrate" else "failover" where morf = if Instance.isRunning i then "migrate" else "failover"
mig = printf "%s -f %s" morf inam::String mig = printf "%s -f %s" morf inam::String
mig_any = printf "%s -f -n %s %s" morf c inam mig_any = printf "%s -f -n %s %s" morf c inam::String
rep n = printf "replace-disks -n %s %s" n inam rep n = printf "replace-disks -n %s %s" n inam::String
-- | Converts a placement to string format. -- | Converts a placement to string format.
printSolutionLine :: Node.List -- ^ The node list printSolutionLine :: Node.List -- ^ The node list
...@@ -1285,14 +1285,13 @@ printSolutionLine nl il nmlen imlen plc pos = ...@@ -1285,14 +1285,13 @@ printSolutionLine nl il nmlen imlen plc pos =
(moves, cmds) = computeMoves inst inam mv npri nsec (moves, cmds) = computeMoves inst inam mv npri nsec
-- FIXME: this should check instead/also the disk template -- FIXME: this should check instead/also the disk template
ostr = if old_sec == Node.noSecondary ostr = if old_sec == Node.noSecondary
then printf "%s" opri then printf "%s" opri::String
else printf "%s:%s" opri osec else printf "%s:%s" opri osec::String
nstr = if s == Node.noSecondary nstr = if s == Node.noSecondary
then printf "%s" npri then printf "%s" npri::String
else printf "%s:%s" npri nsec else printf "%s:%s" npri nsec::String
in (printf " %3d. %-*s %-*s => %-*s %12.8f a=%s" in (printf " %3d. %-*s %-*s => %-*s %12.8f a=%s"
pos imlen inam pmlen (ostr::String) pos imlen inam pmlen ostr pmlen nstr c moves,
pmlen (nstr::String) c moves,
cmds) cmds)
-- | Return the instance and involved nodes in an instance move. -- | Return the instance and involved nodes in an instance move.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{- {-
Copyright (C) 2009, 2010, 2011 Google Inc. Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -40,7 +40,6 @@ module Ganeti.HTools.Utils ...@@ -40,7 +40,6 @@ module Ganeti.HTools.Utils
import Data.Char (toUpper) import Data.Char (toUpper)
import Data.List import Data.List
import Data.Ratio ((%))
import Debug.Trace import Debug.Trace
...@@ -178,8 +177,8 @@ parseUnitValue unit ...@@ -178,8 +177,8 @@ parseUnitValue unit
| unit == "T" || upper == "TB" = return $ mbFactor * kbDecimal * kbDecimal | unit == "T" || upper == "TB" = return $ mbFactor * kbDecimal * kbDecimal
| otherwise = fail $ "Unknown unit '" ++ unit ++ "'" | otherwise = fail $ "Unknown unit '" ++ unit ++ "'"
where upper = map toUpper unit where upper = map toUpper unit
kbBinary = 1024 kbBinary = 1024 :: Rational
kbDecimal = 1000 kbDecimal = 1000 :: Rational
decToBin = kbDecimal / kbBinary -- factor for 1K conversion decToBin = kbDecimal / kbBinary -- factor for 1K conversion
mbFactor = decToBin * decToBin -- twice the factor for just 1K mbFactor = decToBin * decToBin -- twice the factor for just 1K
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment