[ClusterLabs] Waiting in crm shell scripts

Klaus Wenninger kwenning at redhat.com
Wed Nov 9 13:22:03 CET 2016


On 11/09/2016 01:09 PM, Ulrich Windl wrote:
> (subject changed)
>>>> Dejan Muhamedagic <dejanmm at fastmail.fm> schrieb am 08.11.2016 um 21:19 in
> Nachricht <20161108201951.GA4946 at tuttle.homenet>:
>
> [...]
>> crmsh has an option (-w) to wait for the PE to settle after
>> committing configuration changes.
> I didn't know that, but thinking about scripting, it would be more helpful to have:
> *	either a separate "wait" command (maybe with a timeout) to wait for the PE to finish
> *	or "wait" ("-wait"?) as command option, like in "reprobe wait <node>"
>
> I see that there is an option "wait" that is a global toggle, but crmsh/command.py already has a wait(fn) that seems to do what I proposed (Actually I cannot read Python):
> def wait(fn):
>     '''
>     A command with this decorator will
>     force the interactive shell to wait
>     for the command to complete.
>
>         @command
>         @wait
>         def do_bigop(self, cmd, args):
>             ...
>     '''
>     setattr(fn, '_wait', True)
>     return fn
>
> Opinions?

Of course if the highlevel-tooling you are using already provides such a
wait-option that
waits for the cluster to settle after config-changes why not use it on
the last modification
(because it doesn't make sense to wait for the cluster to settle on an
interimistic config).
I didn't know that option of crm_resource before but thanks to Tomas I
think
'crm_resource --wait' is the way to go if you want to do something in
between the last
config change and waiting or if your highlevel-tooling doesn't support it.
 
>
> Regards,
> Ulrich
>
>
>
> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org





More information about the Users mailing list