fab-user
[Top][All Lists]
Advanced

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

[Fab-user] Unexpected results using multiple context managers and virtua


From: Paul Walsh
Subject: [Fab-user] Unexpected results using multiple context managers and virtualenvwrapper
Date: Tue, 3 Dec 2013 00:05:46 +0200

The examples for nested context managers in the docs 
(http://docs.fabfile.org/en/1.8/api/core/context_managers.html) demonstrate 
with virtualenvwrapper.

My code in question also uses virtualenvwrapper, but the results are unexpected:

for example, when my virtualenv project root is:

/srv/project/


And I have a Fabric task like so:

@task
def clone():
    utilities.notify(u'Cloning the data repository.')

    with prefix(env.workon), cd(/srv/project/tmp):
        run(#DO SOMETHING)

I expect the run command to be executed in /srv/project/tmp, but it is executed 
in /srv/project - the venv root.

Changing the order, makes no difference. Nor does nesting like so:

@task
def clone():
    utilities.notify(u'Cloning the data repository.')

    with prefix(env.workon):
        with cd(/srv/project/tmp):
           run(#DO SOMETHING)


Why does any context manager where I activate a virtualenv, *always* put me at 
the root of the virtualenv, seemingly ignoring the other arguments for my 
context?

I'm on Fabric 1.8





reply via email to

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