LGTM. Thanks, Jose
On Fri, Oct 04, 2013 at 01:07:15PM +0200, Klaus Aehlig wrote: > On Fri, Oct 04, 2013 at 11:48:41AM +0200, Jose A. Lopes wrote: > > 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' > > changed as suggested. > > > > > > > > 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 ? > > That's how our GenericMain works. I've added a new option, FORCE_DISTRIBUTION, > to the list of options for the "redist-conf" command, see below. The option > itself is described above: its dest(ination) is the "yes_do_it" field, if > given, > it will "store_true", otherwise the default False is used. The argument opts > then contains the result of processing the options provided. > > > > > > > @@ -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 > > > > > -- > Klaus Aehlig > Google Germany GmbH, Dienerstr. 12, 80331 Muenchen > Registergericht und -nummer: Hamburg, HRB 86891 > Sitz der Gesellschaft: Hamburg > Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores -- 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
