• Iustin Pop's avatar
    Change the order of config updates in some LUs · fe482621
    Iustin Pop authored
    In the start and stop instance LUs, the configuration update is done
    right at the end. This means that if, for example, the instance shutdown
    succeeds, but the drive deactivation fails, the next run of the watcher
    will start the instance again, as it's still marked in running mode.
    
    This patch changes these two LUs so that first the update the
    configuration to the desired state, and only then we proceed to update
    the config. This ensures that the state saved is the desired state.
    
    Because the config might be updated even though the LU failed, this
    patch also modifies the mcpu.Processor.ExecOpCode method to run the
    RunConfigUpdate hook in a finally: phase while the lu.Exec is done in
    its try phase. This ensures that config update hooks (tries to) run at
    all times when the config is updated.
    
    Reviewed-by: schreiberal
    fe482621
cmdlib.py 143 KB