Commit c4460a46 authored by Klaus Aehlig's avatar Klaus Aehlig

Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Improve haskell style
  check-man-warnings: use C.UTF-8 and set LC_ALL
  Fix passing of ispecs in cluster init during QA

Conflicts:
	src/Ganeti/Monitoring/Server.hs: trivial
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parents aa112e9f 8f467ab0
......@@ -20,7 +20,13 @@
set -e
! LANG=en_US.UTF-8 MANWIDTH=80 \
if locale -a | grep -qF 'C.UTF-8'; then
loc="C.UTF-8"
else
loc="en_US.UTF-8"
fi
! LANG="$loc" LC_ALL="$loc" MANWIDTH=80 \
man --warnings --encoding=utf8 --local-file "$1" 2>&1 >/dev/null | \
grep -v -e "cannot adjust line" -e "can't break line" | \
grep .
......@@ -385,7 +385,7 @@ failureReason = show . fst . head
-- | Sorts the failure reasons.
sortReasons :: [(FailMode, Int)] -> [(FailMode, Int)]
sortReasons = reverse . sortBy (comparing snd)
sortReasons = sortBy (flip $ comparing snd)
-- | Runs an allocation algorithm and saves cluster state.
runAllocation :: ClusterData -- ^ Cluster data
......
......@@ -45,6 +45,7 @@ module Ganeti.JQueue
, noSuchJob
) where
import Control.Applicative((<$>))
import Control.Exception
import Control.Monad
import Data.List
......@@ -235,7 +236,7 @@ determineJobDirectories rootdir archived = do
-- FIXME: delete this and just use \'sequence\' instead when Lucid compatibility
-- will not be required anymore.
sequencer :: [Either IOError [JobId]] -> Either IOError [[JobId]]
sequencer l = fmap reverse $ foldl seqFolder (Right []) l
sequencer l = reverse <$> foldl seqFolder (Right []) l
-- | Folding function for joining multiple [JobIds] into one list.
seqFolder :: Either IOError [[JobId]]
......
......@@ -210,8 +210,8 @@ error404 = do
-- | Return the report of one collector.
oneReport :: MVar CollectorMap -> Snap ()
oneReport mvar = do
categoryName <- fmap (maybe mzero unpack) $ getParam "category"
collectorName <- fmap (maybe mzero unpack) $ getParam "collector"
categoryName <- maybe mzero unpack <$> getParam "category"
collectorName <- maybe mzero unpack <$> getParam "collector"
category <-
case catFromName categoryName of
BT.Ok cat -> return cat
......
......@@ -35,6 +35,7 @@ module Test.Ganeti.HTools.Instance
, Instance.Instance(..)
) where
import Control.Applicative ((<$>))
import Control.Monad (liftM)
import Test.QuickCheck hiding (Result)
......@@ -112,7 +113,7 @@ genInstanceOnNodeList nl = do
genInstanceList :: Gen Instance.Instance -> Gen Instance.List
genInstanceList igen = fmap (snd . Loader.assignIndices) names_instances
where names_instances =
(fmap . map) (\n -> (Instance.name n, n)) $ listOf igen
map (\n -> (Instance.name n, n)) <$> listOf igen
-- let's generate a random instance
instance Arbitrary Instance.Instance where
......
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