( Sorry Paul for emailing twice, forgot to hit reply to all )

Why try and do it this way?

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.")

You don't need to use exception handling for these because fabric
already handles the exceptions and passes an object back to you that
you can handle and do what you want with.

On Wed, Jan 18, 2012 at 6:01 PM, Paul Hoffman <[email protected]> wrote:
> On Wed, Jan 18, 2012 at 10:50 AM, Jeff Forcier <[email protected]> wrote:
>> Hey Paul,
>>
>> Is the tutorial not clear enough on this topic? :)
>>
>>    http://docs.fabfile.org/en/1.3.3/tutorial.html#failure
>
> It is clear enough once I figured out the exception. For the record, I
> was using:
>                try:
>                        ThisRet = fabric.api.run(CmdString)
>                except Exception as e:
> Because Fabric is aborting, "Exception" doesn't catch it. It works
> when I change it to:
>                try:
>                        ThisRet = fabric.api.run(CmdString)
>                except BaseException as e:
>
> --Paul Hoffman
>
> _______________________________________________
> Fab-user mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/fab-user

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

Reply via email to