Commit 26d62e4c authored by Iustin Pop's avatar Iustin Pop
Browse files

Rename Ganeti/HTools/Utils.hs to Ganeti/Utils.hs



This is, I believe, the last non-htools specific file that still lived
in the htools directory; it's already widely used in non-htools code,
so let's move it before we add more functionality to this module.

All changes are related to the name change, imports fixup, etc.; there
are no other changes in this patch.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 8a6dbce8
......@@ -421,7 +421,6 @@ HS_LIB_SRCS = \
htools/Ganeti/HTools/Simu.hs \
htools/Ganeti/HTools/Text.hs \
htools/Ganeti/HTools/Types.hs \
htools/Ganeti/HTools/Utils.hs \
htools/Ganeti/HTools/Program.hs \
htools/Ganeti/HTools/Program/Hail.hs \
htools/Ganeti/HTools/Program/Hbal.hs \
......@@ -456,7 +455,8 @@ HS_LIB_SRCS = \
htools/Ganeti/Rpc.hs \
htools/Ganeti/Runtime.hs \
htools/Ganeti/Ssconf.hs \
htools/Ganeti/THH.hs
htools/Ganeti/THH.hs \
htools/Ganeti/Utils.hs
HS_TEST_SRCS = \
htest/Test/Ganeti/BasicTypes.hs \
......@@ -473,7 +473,6 @@ HS_TEST_SRCS = \
htest/Test/Ganeti/HTools/Simu.hs \
htest/Test/Ganeti/HTools/Text.hs \
htest/Test/Ganeti/HTools/Types.hs \
htest/Test/Ganeti/HTools/Utils.hs \
htest/Test/Ganeti/JSON.hs \
htest/Test/Ganeti/Jobs.hs \
htest/Test/Ganeti/Luxi.hs \
......@@ -486,7 +485,8 @@ HS_TEST_SRCS = \
htest/Test/Ganeti/Ssconf.hs \
htest/Test/Ganeti/TestCommon.hs \
htest/Test/Ganeti/TestHTools.hs \
htest/Test/Ganeti/TestHelper.hs
htest/Test/Ganeti/TestHelper.hs \
htest/Test/Ganeti/Utils.hs
HS_LIBTEST_SRCS = $(HS_LIB_SRCS) $(HS_TEST_SRCS)
......
......@@ -48,7 +48,7 @@ import qualified Ganeti.HTools.Loader as Loader
import qualified Ganeti.HTools.Node as Node
import qualified Ganeti.HTools.Text as Text
import qualified Ganeti.HTools.Types as Types
import qualified Ganeti.HTools.Utils as Utils
import qualified Ganeti.Utils as Utils
-- * Instance text loader tests
......
......@@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-}
module Test.Ganeti.HTools.Utils (testHTools_Utils) where
module Test.Ganeti.Utils (testUtils) where
import Test.QuickCheck
......@@ -37,7 +37,7 @@ import Test.Ganeti.TestCommon
import qualified Ganeti.JSON as JSON
import qualified Ganeti.HTools.Types as Types
import qualified Ganeti.HTools.Utils as Utils
import qualified Ganeti.Utils as Utils
-- | Helper to generate a small string that doesn't contain commas.
genNonCommaString :: Gen String
......@@ -120,7 +120,7 @@ prop_parseUnit (NonNegative n) =
n_tb = n_gb * 1000
-- | Test list for the Utils module.
testSuite "HTools/Utils"
testSuite "Utils"
[ 'prop_commaJoinSplit
, 'prop_commaSplitJoin
, 'prop_fromObjWithDefault
......
......@@ -44,7 +44,6 @@ import Test.Ganeti.HTools.PeerMap
import Test.Ganeti.HTools.Simu
import Test.Ganeti.HTools.Text
import Test.Ganeti.HTools.Types
import Test.Ganeti.HTools.Utils
import Test.Ganeti.Jobs
import Test.Ganeti.JSON
import Test.Ganeti.Luxi
......@@ -55,6 +54,7 @@ import Test.Ganeti.Query.Language
import Test.Ganeti.Query.Query
import Test.Ganeti.Rpc
import Test.Ganeti.Ssconf
import Test.Ganeti.Utils
-- | Our default test options, overring the built-in test-framework
-- ones (but not the supplied command line parameters).
......@@ -85,7 +85,6 @@ allTests =
, testHTools_Simu
, testHTools_Text
, testHTools_Types
, testHTools_Utils
, testJSON
, testJobs
, testLuxi
......@@ -96,6 +95,7 @@ allTests =
, testQuery_Query
, testRpc
, testSsconf
, testUtils
]
-- | Main function. Note we don't use defaultMain since we want to
......
......@@ -47,13 +47,13 @@ import System.INotify
import Ganeti.Daemon
import Ganeti.JSON
import Ganeti.HTools.Types
import Ganeti.HTools.Utils
import Ganeti.Objects
import Ganeti.Confd
import Ganeti.Confd.Utils
import Ganeti.Config
import Ganeti.Hash
import Ganeti.Logging
import Ganeti.Utils
import qualified Ganeti.Constants as C
import qualified Ganeti.Path as Path
import Ganeti.Query.Server (runQueryD)
......
......@@ -42,7 +42,7 @@ import Ganeti.Hash
import qualified Ganeti.Constants as C
import qualified Ganeti.Path as Path
import Ganeti.JSON
import Ganeti.HTools.Utils
import Ganeti.Utils
-- | Returns the HMAC key.
getClusterHmac :: IO HashKey
......
......@@ -65,7 +65,7 @@ import Ganeti.Common as Common
import Ganeti.Logging
import Ganeti.Runtime
import Ganeti.BasicTypes
import Ganeti.HTools.Utils
import Ganeti.Utils
import qualified Ganeti.Constants as C
import qualified Ganeti.Ssconf as Ssconf
......
{-| Implementation of command-line functions.
This module holds the common command-line related functions for the
binaries, separated into this module since "Ganeti.HTools.Utils" is
binaries, separated into this module since "Ganeti.Utils" is
used in many other places and this is more IO oriented.
-}
......@@ -95,9 +95,9 @@ import qualified Ganeti.HTools.Container as Container
import qualified Ganeti.HTools.Node as Node
import qualified Ganeti.Path as Path
import Ganeti.HTools.Types
import Ganeti.HTools.Utils
import Ganeti.BasicTypes
import Ganeti.Common as Common
import Ganeti.Utils
-- * Data types
......
......@@ -86,9 +86,9 @@ import qualified Ganeti.HTools.Instance as Instance
import qualified Ganeti.HTools.Node as Node
import qualified Ganeti.HTools.Group as Group
import Ganeti.HTools.Types
import Ganeti.HTools.Utils
import Ganeti.Compat
import qualified Ganeti.OpCodes as OpCodes
import Ganeti.Utils
-- * Types
......
......@@ -51,7 +51,7 @@ import Ganeti.HTools.Loader (mergeData, checkData, ClusterData(..)
import Ganeti.HTools.Types
import Ganeti.HTools.CLI
import Ganeti.HTools.Utils (sepSplit, tryRead, exitIfBad, exitWhen)
import Ganeti.Utils (sepSplit, tryRead, exitIfBad, exitWhen)
-- | Error beautifier.
wrapIO :: IO (Result a) -> IO (Result a)
......
......@@ -60,7 +60,7 @@ module Ganeti.HTools.Instance
import qualified Ganeti.HTools.Types as T
import qualified Ganeti.HTools.Container as Container
import Ganeti.HTools.Utils
import Ganeti.Utils
-- * Type declarations
......
......@@ -52,7 +52,7 @@ import qualified Ganeti.HTools.Cluster as Cluster
import Ganeti.BasicTypes
import Ganeti.HTools.Types
import Ganeti.HTools.Utils
import Ganeti.Utils
-- * Constants
......
......@@ -50,9 +50,9 @@ import qualified Ganeti.HTools.Instance as Instance
import Ganeti.HTools.CLI
import Ganeti.HTools.ExtLoader
import Ganeti.HTools.Utils
import Ganeti.HTools.Types
import Ganeti.HTools.Loader
import Ganeti.Utils
import qualified Ganeti.Luxi as L
import Ganeti.Jobs
......
......@@ -38,10 +38,10 @@ import qualified Ganeti.HTools.Node as Node
import qualified Ganeti.HTools.Group as Group
import qualified Ganeti.HTools.Instance as Instance
import Ganeti.HTools.Utils
import Ganeti.HTools.CLI
import Ganeti.HTools.ExtLoader
import Ganeti.HTools.Loader
import Ganeti.Utils
-- | Options list and functions.
options :: [OptType]
......
......@@ -40,11 +40,11 @@ import qualified Ganeti.HTools.Cluster as Cluster
import qualified Ganeti.HTools.Node as Node
import qualified Ganeti.HTools.Instance as Instance
import Ganeti.HTools.Utils
import Ganeti.HTools.Types
import Ganeti.HTools.CLI
import Ganeti.HTools.ExtLoader
import Ganeti.HTools.Loader
import Ganeti.Utils
-- | Options list and functions.
options :: [OptType]
......
......@@ -33,7 +33,7 @@ module Ganeti.HTools.Simu
import Control.Monad (mplus, zipWithM)
import Text.Printf (printf)
import Ganeti.HTools.Utils
import Ganeti.Utils
import Ganeti.HTools.Types
import Ganeti.HTools.Loader
import qualified Ganeti.HTools.Container as Container
......
......@@ -47,7 +47,7 @@ import Data.List
import Text.Printf (printf)
import Ganeti.HTools.Utils
import Ganeti.Utils
import Ganeti.HTools.Loader
import Ganeti.HTools.Types
import qualified Ganeti.HTools.Container as Container
......
......@@ -69,7 +69,7 @@ import qualified Network.Socket as S
import Ganeti.JSON
import Ganeti.HTools.Types
import Ganeti.HTools.Utils
import Ganeti.Utils
import Ganeti.Constants
import Ganeti.Jobs (JobStatus)
......
......@@ -48,7 +48,7 @@ import System.IO.Error (isDoesNotExistError)
import qualified Ganeti.Constants as C
import qualified Ganeti.Path as Path
import Ganeti.BasicTypes
import Ganeti.HTools.Utils
import Ganeti.Utils
-- | Maximum ssconf file size we support.
maxFileSize :: Int
......
......@@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-}
module Ganeti.HTools.Utils
module Ganeti.Utils
( debug
, debugFn
, debugXy
......
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