Skip to content
Snippets Groups Projects
Commit 02da9d07 authored by Iustin Pop's avatar Iustin Pop
Browse files

Add a new option --save-cluster

This option will in the future be used to serialize the cluster state in
hbal and hspace after the rebalance/allocation steps.
parent 50811e2c
No related branches found
Tags htools-v0.0.6
No related merge requests found
...@@ -8,7 +8,7 @@ and this is more IO oriented. ...@@ -8,7 +8,7 @@ and this is more IO oriented.
{- {-
Copyright (C) 2009 Google Inc. Copyright (C) 2009, 2010 Google Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -60,6 +60,7 @@ module Ganeti.HTools.CLI ...@@ -60,6 +60,7 @@ module Ganeti.HTools.CLI
, oPrintNodes , oPrintNodes
, oQuiet , oQuiet
, oRapiMaster , oRapiMaster
, oSaveCluster
, oShowHelp , oShowHelp
, oShowVer , oShowVer
, oTieredSpec , oTieredSpec
...@@ -105,6 +106,7 @@ data Options = Options ...@@ -105,6 +106,7 @@ data Options = Options
, optOffline :: [String] -- ^ Names of offline nodes , optOffline :: [String] -- ^ Names of offline nodes
, optOneline :: Bool -- ^ Switch output to a single line , optOneline :: Bool -- ^ Switch output to a single line
, optOutPath :: FilePath -- ^ Path to the output directory , optOutPath :: FilePath -- ^ Path to the output directory
, optSaveCluster :: Maybe FilePath -- ^ Save cluster state to this file
, optShowCmds :: Maybe FilePath -- ^ Whether to show the command list , optShowCmds :: Maybe FilePath -- ^ Whether to show the command list
, optShowHelp :: Bool -- ^ Just show the help , optShowHelp :: Bool -- ^ Just show the help
, optShowInsts :: Bool -- ^ Whether to show the instance map , optShowInsts :: Bool -- ^ Whether to show the instance map
...@@ -137,6 +139,7 @@ defaultOptions = Options ...@@ -137,6 +139,7 @@ defaultOptions = Options
, optOffline = [] , optOffline = []
, optOneline = False , optOneline = False
, optOutPath = "." , optOutPath = "."
, optSaveCluster = Nothing
, optShowCmds = Nothing , optShowCmds = Nothing
, optShowHelp = False , optShowHelp = False
, optShowInsts = False , optShowInsts = False
...@@ -304,6 +307,11 @@ oRapiMaster = Option "m" ["master"] ...@@ -304,6 +307,11 @@ oRapiMaster = Option "m" ["master"]
(ReqArg (\ m opts -> Ok opts { optMaster = m }) "ADDRESS") (ReqArg (\ m opts -> Ok opts { optMaster = m }) "ADDRESS")
"collect data via RAPI at the given ADDRESS" "collect data via RAPI at the given ADDRESS"
oSaveCluster :: OptType
oSaveCluster = Option "S" ["save"]
(ReqArg (\ f opts -> Ok opts { optSaveCluster = Just f }) "FILE")
"Save cluster state at the end of the processing to FILE"
oShowHelp :: OptType oShowHelp :: OptType
oShowHelp = Option "h" ["help"] oShowHelp = Option "h" ["help"]
(NoArg (\ opts -> Ok opts { optShowHelp = True})) (NoArg (\ opts -> Ok opts { optShowHelp = True}))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment