fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Virtualenv Use Case


From: Jeff Forcier
Subject: Re: [Fab-user] Virtualenv Use Case
Date: Sat, 2 May 2009 11:53:49 -0400

On Sat, May 2, 2009 at 11:27 AM, s s <address@hidden> wrote:

> Yes.  Context managers are 2.5+ but that's fine with me.  You only need 2.5
> on the deployer i.e. your development machine so I don't think this should
> be too much of a problem.

Fabric is officially 2.5+ only [1], so yea. Context managers are
totally a good thing and I want to use more of them :)

[1] http://docs.fabfile.org/compatibility.html#python-version

> Only thing with that is you lose the ability to grab error/status info from
> each command.  One of my other use-cases involves finding out whether a
> command exists on the target machine (wget, for example) and installing it
> if it doesn't.

This is another reason to prefer the context manager approach, as it
combines the best of both worlds: your commands still get run with the
appropriate shell environment, but you also still have discrete
run/sudo invocations, complete with their own return codes/failure
handling/etc.

One edge case this doesn't cover is when one of your shell commands
modifies the shell environment itself, but I'm not sure if that
happens often enough to merit doing a lot of switching things around
or adding lots of complexity, though.

-Jeff




reply via email to

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