LGTM On Thu, Dec 3, 2015 at 11:42 AM 'Klaus Aehlig' via ganeti-devel < [email protected]> wrote:
> Add a new flag, --dry-run, to the available flags in htools. > It will be used for harep to allow diagnose-only runs. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > src/Ganeti/HTools/CLI.hs | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/src/Ganeti/HTools/CLI.hs b/src/Ganeti/HTools/CLI.hs > index bf291d7..7ca25d9 100644 > --- a/src/Ganeti/HTools/CLI.hs > +++ b/src/Ganeti/HTools/CLI.hs > @@ -56,6 +56,7 @@ module Ganeti.HTools.CLI > , oDataFile > , oDiskMoves > , oDiskTemplate > + , oDryRun > , oSpindleUse > , oDynuFile > , oMonD > @@ -162,6 +163,7 @@ data Options = Options > , optExInst :: [String] -- ^ Instances to be excluded > , optExTags :: Maybe [String] -- ^ Tags to use for exclusion > , optExecJobs :: Bool -- ^ Execute the commands via Luxi > + , optDryRun :: Bool -- ^ Only do a dry run > , optFirstJobGroup :: Bool -- ^ Only execute the first group of > jobs > , optForce :: Bool -- ^ Force the execution > , optFullEvacuation :: Bool -- ^ Fully evacuate nodes to be > rebooted > @@ -233,6 +235,7 @@ defaultOptions = Options > , optExInst = [] > , optExTags = Nothing > , optExecJobs = False > + , optDryRun = False > , optFirstJobGroup = False > , optForce = False > , optFullEvacuation = False > @@ -476,6 +479,13 @@ oExecJobs = > \ it for data gathering)", > OptComplNone) > > +oDryRun :: OptType > +oDryRun = > + (Option "" ["dry-run"] > + (NoArg (\ opts -> Ok opts { optDryRun = True})) > + "do not execute any commands and just report what would be done", > + OptComplNone) > + > oReason :: OptType > oReason = > (Option "" ["reason"] > -- > 2.6.0.rc2.230.g3dd15c0 > > -- Lisa Velden Software Engineer [email protected] Google Germany GmbH Dienerstraße 12 80331 München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg
