On Wed, Jan 18, 2012 at 10:07 PM, Steve Hajducko <[email protected]> wrote:
> Why try and do it this way?

Because the method in the tutorial doesn't work in many cases that one
might care about.

> The tutorial lists a much simpler way:
>
> with settings(warn_only=True):
>        ThisRet = fabric.api.run(CmdString)
>    if ThisRet.failed and not confirm("Tests failed. Continue anyway?"):
>        abort("Aborting at user request.")

That only works if the CmdString gets executed and returns a non-zero
value. If CmdString doesn't get executed (such as because the target
machine is down or you use the wrong password), the program aborts
before the "if ThisRet.failed" is evaluated.

This is related to my question earlier this week about "put" as well.

--Paul Hoffman

_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to