fab-user
[Top][All Lists]
Advanced

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

[Fab-user] The meaning of failure


From: Jeff Forcier
Subject: [Fab-user] The meaning of failure
Date: Fri, 4 Jul 2008 22:23:35 -0400

Hi Christian,

I'm poking at the failure code and Fabric seems a little inconsistent,
and I'm trying to figure out if it's just me.

On the one hand, local() and load() have the newer behavior set up,
where users can specify ignore, warn or abort, and other operations
are clearly intended to get this behavior as their docstrings mention
it. On the other hand, _on_hosts_do() and the strategies expect a
Boolean return value from operations and abort immediately on False.
That doesn't jive well with the concept of allowing users to state
they want errors ignored or simply warned about.

I think the best approach is to remove the "fail-fast" aspect of the
strategies and _on_hosts_do, i.e. to (for now) ignore the return
value, and to roll out the new behavior everywhere instead. I've got a
local commit where I refactored that behavior -- check failure code,
emit warning if warning, abort if abort -- to make this a bit easier.
That patch is attached for your perusal -- didn't want to push to
GitHub until I've actually changed functionality.

At one point I was wondering if exceptions would work well here, but I
don't think that's the case; we'd need more lines of code per
operation to deal with that correctly (especially concerning "ignore")
than if we just use a refactored _fail() function.

Anyway, do you have any thoughts on the matter? Anything I'm missing?

Thanks,
Jeff

Attachment: failure.patch
Description: Binary data


reply via email to

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