On Wed, Oct 02, 2013 at 02:33:06PM +0200, Klaus Aehlig wrote: > Add a new option to gnt-cluster redist-conf allowing to ignore a drained > state of the Ganeti queue. This is needed (until we implement the fine-grained > queue control) during upgrades, as here we have to redistribute the > configuration > to all nodes before undraining the queue.
s/gnt-cluster redist-conf/'gnt-cluster redist-conf' > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > lib/client/gnt_cluster.py | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py > index 218312e..8d81519 100644 > --- a/lib/client/gnt_cluster.py > +++ b/lib/client/gnt_cluster.py > @@ -58,6 +58,12 @@ FORCE_FAILOVER = cli_option("--yes-do-it", > dest="yes_do_it", > help="Override interactive check for > --no-voting", > default=False, action="store_true") > > +FORCE_DISTRIBUTION = cli_option("--yes-do-it", dest="yes_do_it", > + help="Unconditionally distribute the" > + " configuration, even if the queue" > + " is drained", > + default=False, action="store_true") > + > _EPO_PING_INTERVAL = 30 # 30 seconds between pings > _EPO_PING_TIMEOUT = 1 # 1 second > _EPO_REACHABLE_TIMEOUT = 15 * 60 # 15 minutes > @@ -393,7 +399,10 @@ def RedistributeConfig(opts, args): > > """ > op = opcodes.OpClusterRedistConf() > - SubmitOrSend(op, opts) > + if opts.yes_do_it: > + SubmitOpCodeToDrainedQueue(op) > + else: > + SubmitOrSend(op, opts) > return 0 I am not too familiar with this code, can you elaborate why use 'opts.yes_do_it' here ? Thanks, Jose > > > @@ -1630,7 +1639,8 @@ commands = { > "<new_name>", > "Renames the cluster"), > "redist-conf": ( > - RedistributeConfig, ARGS_NONE, SUBMIT_OPTS + [DRY_RUN_OPT, PRIORITY_OPT], > + RedistributeConfig, ARGS_NONE, SUBMIT_OPTS + > + [DRY_RUN_OPT, PRIORITY_OPT, FORCE_DISTRIBUTION], > "", "Forces a push of the configuration file and ssconf files" > " to the nodes in the cluster"), > "verify": ( > -- > 1.8.4 > -- Jose Antonio Lopes Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores Steuernummer: 48/725/00206 Umsatzsteueridentifikationsnummer: DE813741370
