Revision b69be409
b/htools/Ganeti/HTools/IAlloc.hs | ||
---|---|---|
47 | 47 |
import Ganeti.HTools.CLI |
48 | 48 |
import Ganeti.HTools.Loader |
49 | 49 |
import Ganeti.HTools.ExtLoader (loadExternalData) |
50 |
import Ganeti.HTools.Utils
|
|
50 |
import Ganeti.HTools.JSON
|
|
51 | 51 |
import Ganeti.HTools.Types |
52 | 52 |
|
53 | 53 |
{-# ANN module "HLint: ignore Eta reduce" #-} |
b/htools/Ganeti/HTools/Luxi.hs | ||
---|---|---|
38 | 38 |
import qualified Ganeti.HTools.Group as Group |
39 | 39 |
import qualified Ganeti.HTools.Node as Node |
40 | 40 |
import qualified Ganeti.HTools.Instance as Instance |
41 |
import Ganeti.HTools.Utils (fromJVal, tryFromObj, asJSObject, |
|
42 |
fromObj) |
|
41 |
import Ganeti.HTools.JSON |
|
43 | 42 |
|
44 | 43 |
{-# ANN module "HLint: ignore Eta reduce" #-} |
45 | 44 |
|
b/htools/Ganeti/HTools/QC.hs | ||
---|---|---|
55 | 55 |
import qualified Ganeti.HTools.ExtLoader |
56 | 56 |
import qualified Ganeti.HTools.IAlloc as IAlloc |
57 | 57 |
import qualified Ganeti.HTools.Instance as Instance |
58 |
import qualified Ganeti.HTools.JSON as JSON |
|
58 | 59 |
import qualified Ganeti.HTools.Loader as Loader |
59 | 60 |
import qualified Ganeti.HTools.Luxi |
60 | 61 |
import qualified Ganeti.HTools.Node as Node |
... | ... | |
313 | 314 |
-- value. |
314 | 315 |
prop_Utils_fromObjWithDefault def_value random_key = |
315 | 316 |
-- a missing key will be returned with the default |
316 |
Utils.fromObjWithDefault [] random_key def_value == Just def_value &&
|
|
317 |
JSON.fromObjWithDefault [] random_key def_value == Just def_value &&
|
|
317 | 318 |
-- a found key will be returned as is, not with default |
318 |
Utils.fromObjWithDefault [(random_key, J.showJSON def_value)]
|
|
319 |
JSON.fromObjWithDefault [(random_key, J.showJSON def_value)]
|
|
319 | 320 |
random_key (def_value+1) == Just def_value |
320 | 321 |
where _types = def_value :: Integer |
321 | 322 |
|
b/htools/Ganeti/HTools/Rapi.hs | ||
---|---|---|
40 | 40 |
import Text.JSON.Types (JSValue(..)) |
41 | 41 |
import Text.Printf (printf) |
42 | 42 |
|
43 |
import Ganeti.HTools.Utils |
|
44 | 43 |
import Ganeti.HTools.Loader |
45 | 44 |
import Ganeti.HTools.Types |
45 |
import Ganeti.HTools.JSON |
|
46 | 46 |
import qualified Ganeti.HTools.Group as Group |
47 | 47 |
import qualified Ganeti.HTools.Node as Node |
48 | 48 |
import qualified Ganeti.HTools.Instance as Instance |
b/htools/Ganeti/HTools/Utils.hs | ||
---|---|---|
31 | 31 |
, select |
32 | 32 |
, applyIf |
33 | 33 |
, commaJoin |
34 |
, readEitherString |
|
35 |
, JSRecord |
|
36 |
, loadJSArray |
|
37 |
, fromObj |
|
38 |
, fromObjWithDefault |
|
39 |
, maybeFromObj |
|
40 |
, tryFromObj |
|
41 |
, fromJVal |
|
42 |
, asJSObject |
|
43 |
, asObjectList |
|
44 |
, fromJResult |
|
45 | 34 |
, tryRead |
46 | 35 |
, formatTable |
47 | 36 |
, parseUnit |
... | ... | |
52 | 41 |
|
53 | 42 |
import Debug.Trace |
54 | 43 |
|
55 |
-- we will re-export these for our existing users |
|
56 |
import Ganeti.HTools.JSON |
|
57 |
|
|
58 | 44 |
-- * Debug functions |
59 | 45 |
|
60 | 46 |
-- | To be used only for debugging, breaks referential integrity. |
b/htools/Ganeti/Luxi.hs | ||
---|---|---|
46 | 46 |
import System.Timeout |
47 | 47 |
import qualified Network.Socket as S |
48 | 48 |
|
49 |
import Ganeti.HTools.Utils
|
|
49 |
import Ganeti.HTools.JSON
|
|
50 | 50 |
import Ganeti.HTools.Types |
51 | 51 |
|
52 | 52 |
import Ganeti.Constants |
b/htools/Ganeti/OpCodes.hs | ||
---|---|---|
32 | 32 |
) where |
33 | 33 |
|
34 | 34 |
import Text.JSON (readJSON, showJSON, makeObj, JSON) |
35 |
import qualified Text.JSON as J |
|
36 | 35 |
|
37 | 36 |
import qualified Ganeti.Constants as C |
38 | 37 |
import Ganeti.THH |
39 | 38 |
|
40 |
import Ganeti.HTools.Utils
|
|
39 |
import Ganeti.HTools.JSON
|
|
41 | 40 |
|
42 | 41 |
-- | Replace disks type. |
43 | 42 |
$(declareSADT "ReplaceDisksMode" |
Also available in: Unified diff