[ClusterLabs] Waiting in crm shell scripts

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Wed Nov 9 07:09:57 EST 2016


(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?

Regards,
Ulrich






More information about the Users mailing list