X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/26d62e4ced78ba5f3fea05583dae54b1324ed33a..29a3053378d72e6897799c16fe61d136b28ca1e0:/htools/Ganeti/HTools/Program/Hspace.hs?ds=sidebyside diff --git a/htools/Ganeti/HTools/Program/Hspace.hs b/htools/Ganeti/HTools/Program/Hspace.hs index 605b4ff..d1b62c3 100644 --- a/htools/Ganeti/HTools/Program/Hspace.hs +++ b/htools/Ganeti/HTools/Program/Hspace.hs @@ -23,7 +23,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -} -module Ganeti.HTools.Program.Hspace (main, options) where +module Ganeti.HTools.Program.Hspace + (main + , options + , arguments + ) where import Control.Monad import Data.Char (toUpper, toLower) @@ -40,6 +44,8 @@ import qualified Ganeti.HTools.Cluster as Cluster import qualified Ganeti.HTools.Node as Node import qualified Ganeti.HTools.Instance as Instance +import Ganeti.BasicTypes +import Ganeti.Common import Ganeti.HTools.Types import Ganeti.HTools.CLI import Ganeti.HTools.ExtLoader @@ -47,27 +53,33 @@ import Ganeti.HTools.Loader import Ganeti.Utils -- | Options list and functions. -options :: [OptType] -options = - [ oPrintNodes - , oDataFile - , oDiskTemplate - , oSpindleUse - , oNodeSim - , oRapiMaster - , oLuxiSocket - , oIAllocSrc - , oVerbose - , oQuiet - , oOfflineNode - , oMachineReadable - , oMaxCpu - , oMaxSolLength - , oMinDisk - , oStdSpec - , oTieredSpec - , oSaveCluster - ] +options :: IO [OptType] +options = do + luxi <- oLuxiSocket + return + [ oPrintNodes + , oDataFile + , oDiskTemplate + , oSpindleUse + , oNodeSim + , oRapiMaster + , luxi + , oIAllocSrc + , oVerbose + , oQuiet + , oOfflineNode + , oMachineReadable + , oMaxCpu + , oMaxSolLength + , oMinDisk + , oStdSpec + , oTieredSpec + , oSaveCluster + ] + +-- | The list of arguments supported by the program. +arguments :: [ArgCompletion] +arguments = [] -- | The allocation phase we're in (initial, after tiered allocs, or -- after regular allocation). @@ -112,7 +124,7 @@ cpuEff :: Cluster.CStats -> Double cpuEff = effFn Cluster.csIcpu (fromIntegral . Cluster.csVcpu) -- | Holds data for converting a 'Cluster.CStats' structure into --- detailed statictics. +-- detailed statistics. statsData :: [(String, Cluster.CStats -> String)] statsData = [ ("SCORE", printf "%.8f" . Cluster.csScore) , ("INST_CNT", printf "%d" . Cluster.csNinst) @@ -377,7 +389,7 @@ instFromSpec spx = -- | Main function. main :: Options -> [String] -> IO () main opts args = do - exitUnless (null args) "this program doesn't take any arguments" + exitUnless (null args) "This program doesn't take any arguments." let verbose = optVerbose opts machine_r = optMachineReadable opts