Commit b69be409 authored by Iustin Pop's avatar Iustin Pop
Browse files

Stop exporting JSON functionality from Utils.hs

This completes the Utils/JSON split started in commit f047f90f

. The
import graph should be cleaner now.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent f3f76ccc
......@@ -47,7 +47,7 @@ import qualified Ganeti.Constants as C
import Ganeti.HTools.CLI
import Ganeti.HTools.Loader
import Ganeti.HTools.ExtLoader (loadExternalData)
import Ganeti.HTools.Utils
import Ganeti.HTools.JSON
import Ganeti.HTools.Types
{-# ANN module "HLint: ignore Eta reduce" #-}
......
......@@ -38,8 +38,7 @@ import Ganeti.HTools.Types
import qualified Ganeti.HTools.Group as Group
import qualified Ganeti.HTools.Node as Node
import qualified Ganeti.HTools.Instance as Instance
import Ganeti.HTools.Utils (fromJVal, tryFromObj, asJSObject,
fromObj)
import Ganeti.HTools.JSON
{-# ANN module "HLint: ignore Eta reduce" #-}
......
......@@ -55,6 +55,7 @@ import qualified Ganeti.HTools.Container as Container
import qualified Ganeti.HTools.ExtLoader
import qualified Ganeti.HTools.IAlloc as IAlloc
import qualified Ganeti.HTools.Instance as Instance
import qualified Ganeti.HTools.JSON as JSON
import qualified Ganeti.HTools.Loader as Loader
import qualified Ganeti.HTools.Luxi
import qualified Ganeti.HTools.Node as Node
......@@ -313,9 +314,9 @@ prop_Utils_commaSplitJoin s =
-- value.
prop_Utils_fromObjWithDefault def_value random_key =
-- a missing key will be returned with the default
Utils.fromObjWithDefault [] random_key def_value == Just def_value &&
JSON.fromObjWithDefault [] random_key def_value == Just def_value &&
-- a found key will be returned as is, not with default
Utils.fromObjWithDefault [(random_key, J.showJSON def_value)]
JSON.fromObjWithDefault [(random_key, J.showJSON def_value)]
random_key (def_value+1) == Just def_value
where _types = def_value :: Integer
......
......@@ -40,9 +40,9 @@ import Text.JSON (JSObject, fromJSObject, decodeStrict)
import Text.JSON.Types (JSValue(..))
import Text.Printf (printf)
import Ganeti.HTools.Utils
import Ganeti.HTools.Loader
import Ganeti.HTools.Types
import Ganeti.HTools.JSON
import qualified Ganeti.HTools.Group as Group
import qualified Ganeti.HTools.Node as Node
import qualified Ganeti.HTools.Instance as Instance
......
......@@ -31,17 +31,6 @@ module Ganeti.HTools.Utils
, select
, applyIf
, commaJoin
, readEitherString
, JSRecord
, loadJSArray
, fromObj
, fromObjWithDefault
, maybeFromObj
, tryFromObj
, fromJVal
, asJSObject
, asObjectList
, fromJResult
, tryRead
, formatTable
, parseUnit
......@@ -52,9 +41,6 @@ import Data.List
import Debug.Trace
-- we will re-export these for our existing users
import Ganeti.HTools.JSON
-- * Debug functions
-- | To be used only for debugging, breaks referential integrity.
......
......@@ -46,7 +46,7 @@ import Text.JSON.Types
import System.Timeout
import qualified Network.Socket as S
import Ganeti.HTools.Utils
import Ganeti.HTools.JSON
import Ganeti.HTools.Types
import Ganeti.Constants
......
......@@ -32,12 +32,11 @@ module Ganeti.OpCodes
) where
import Text.JSON (readJSON, showJSON, makeObj, JSON)
import qualified Text.JSON as J
import qualified Ganeti.Constants as C
import Ganeti.THH
import Ganeti.HTools.Utils
import Ganeti.HTools.JSON
-- | Replace disks type.
$(declareSADT "ReplaceDisksMode"
......
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