diff --git a/htools/Ganeti/HTools/Cluster.hs b/htools/Ganeti/HTools/Cluster.hs index 95178e46a72ca7bbde83ad0100c2c48b8804eb5a..f839e75cada410fcf83db61afe4dcf6cd55dc198 100644 --- a/htools/Ganeti/HTools/Cluster.hs +++ b/htools/Ganeti/HTools/Cluster.hs @@ -1028,7 +1028,7 @@ printInsts nl il = in if sdx == Node.noSecondary then "" else Container.nameOf nl sdx - , if Instance.auto_balance inst then "Y" else "N" + , if Instance.autoBalance inst then "Y" else "N" , printf "%3d" $ Instance.vcpus inst , printf "%5d" $ Instance.mem inst , printf "%5d" $ Instance.dsk inst `div` 1024 diff --git a/htools/Ganeti/HTools/Instance.hs b/htools/Ganeti/HTools/Instance.hs index e21c30ef815b2eeb0e453f1b274bd40adaff43ce..4cf80586d290685c3a634cecef39f0e2c21e6cc8 100644 --- a/htools/Ganeti/HTools/Instance.hs +++ b/htools/Ganeti/HTools/Instance.hs @@ -63,7 +63,7 @@ data Instance = Instance , idx :: T.Idx -- ^ Internal index , util :: T.DynUtil -- ^ Dynamic resource usage , movable :: Bool -- ^ Can the instance be moved? - , auto_balance :: Bool -- ^ Is the instance auto-balanced? + , autoBalance :: Bool -- ^ Is the instance auto-balanced? , tags :: [String] -- ^ List of instance tags } deriving (Show, Read) @@ -107,7 +107,7 @@ create name_init mem_init dsk_init vcpus_init run_init tags_init , util = T.baseUtil , tags = tags_init , movable = True - , auto_balance = auto_balance_init + , autoBalance = auto_balance_init } -- | Changes the index. diff --git a/htools/Ganeti/HTools/Node.hs b/htools/Ganeti/HTools/Node.hs index 5394904ad500b9763eeaa42104b6e85c3abd8624..cc723ad4351c5981541ae06eeac28ff70f5f027a 100644 --- a/htools/Ganeti/HTools/Node.hs +++ b/htools/Ganeti/HTools/Node.hs @@ -266,7 +266,7 @@ buildPeers :: Node -> Instance.List -> Node buildPeers t il = let mdata = map (\i_idx -> let inst = Container.find i_idx il - mem = if Instance.auto_balance inst + mem = if Instance.autoBalance inst then Instance.mem inst else 0 in (Instance.pNode inst, mem)) @@ -332,7 +332,7 @@ removeSec t inst = new_dsk = fDsk t + Instance.dsk inst old_peers = peers t old_peem = P.find pnode old_peers - new_peem = if Instance.auto_balance inst + new_peem = if Instance.autoBalance inst then old_peem - Instance.mem inst else old_peem new_peers = if new_peem > 0 @@ -407,7 +407,7 @@ addSecEx force t inst pdx = old_peers = peers t old_mem = fMem t new_dsk = fDsk t - Instance.dsk inst - secondary_needed_mem = if Instance.auto_balance inst + secondary_needed_mem = if Instance.autoBalance inst then Instance.mem inst else 0 new_peem = P.find pdx old_peers + secondary_needed_mem diff --git a/htools/Ganeti/HTools/QC.hs b/htools/Ganeti/HTools/QC.hs index df3051bc26e8a760755da9bfcfbe0ac52ec8caa4..241caf80242704022f79e24a4f9f951ec5be028d 100644 --- a/htools/Ganeti/HTools/QC.hs +++ b/htools/Ganeti/HTools/QC.hs @@ -529,7 +529,7 @@ prop_Text_Load_Instance name mem dsk vcpus status Instance.sNode i == (if null snode then Node.noSecondary else sdx) && - Instance.auto_balance i == autobal && + Instance.autoBalance i == autobal && isNothing fail1 prop_Text_Load_InstanceFail ktn fields = @@ -652,11 +652,11 @@ prop_Node_rMem inst = forAll (arbitrary `suchThat` ((> 0) . Node.fMem)) $ \node -> -- ab = auto_balance, nb = non-auto_balance -- we use -1 as the primary node of the instance - let inst' = inst { Instance.pNode = -1, Instance.auto_balance = True } + let inst' = inst { Instance.pNode = -1, Instance.autoBalance = True } inst_ab = setInstanceSmallerThanNode node inst' - inst_nb = inst_ab { Instance.auto_balance = False } + inst_nb = inst_ab { Instance.autoBalance = False } -- now we have the two instances, identical except the - -- auto_balance attribute + -- autoBalance attribute orig_rmem = Node.rMem node inst_idx = Instance.idx inst_ab node_add_ab = Node.addSec node inst_ab (-1) diff --git a/htools/Ganeti/HTools/Text.hs b/htools/Ganeti/HTools/Text.hs index 05eff2d534037471d4ddfc766e8722eb4aca1b8f..fccb65237264600247f8f8def0df184deb553cf5 100644 --- a/htools/Ganeti/HTools/Text.hs +++ b/htools/Ganeti/HTools/Text.hs @@ -96,7 +96,7 @@ serializeInstance nl inst = printf "%s|%d|%d|%d|%s|%s|%s|%s|%s" iname (Instance.mem inst) (Instance.dsk inst) (Instance.vcpus inst) (Instance.runSt inst) - (if Instance.auto_balance inst then "Y" else "N") + (if Instance.autoBalance inst then "Y" else "N") pnode snode (intercalate "," (Instance.tags inst)) -- | Generate instance file data from instance objects.