fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] try: run except run ?


From: Jeff Forcier
Subject: Re: [Fab-user] try: run except run ?
Date: Wed, 20 May 2009 17:03:03 -0400

Hi Jorge,

First, note that you may want to try using
`fabric.contrib.files.contains` instead of manually calling
``run('grep text file')``. It's got a couple of niceties that should
make it relatively useful, though I'm sure it could be expanded upon.

> but this bit of code in run() is preventing it from happening
>
> <snip>
>
> how can I do this?

How exactly is it preventing it from happening? If you mean the
failure handler is causing Fabric to abort, then what you want is to
do the following to change Fab's behavior from "abort always" to "only
warn me, and keep going"::

    with settings(warn_only=True):
        run('foo')

However, note that ``contrib.files.contains`` already does this internally --
i.e. it will always return True or False and will never cause Fabric to bail
out -- which is another big reason to use it IMHO :)

Thanks,
Jeff




reply via email to

[Prev in Thread] Current Thread [Next in Thread]