I'm just a beginning to use fabric.  I'm running under a Windows 7 and using 
MinGW with msys in order to replicate a unix-like bash shell environment.  

When I use the local() function, the working directory is changed to the root 
of my c: drive.  If I call subprocess.call(), than the current working 
directory is correct.  If I set "shell=True", in the subprocess.call, then the 
directory is also incorrect.  My fabfile.py:

====================================
from fabric.api import local
import subprocess

def prepare_deploy():
    local("pwd")
    subprocess.call("pwd")
    subprocess.call("pwd", shell=True)
====================================

What I see in my msys shell:

====================================
gkvj4293@SF-EISENMAN /c/Users/gkvj4293/tmp
$ pwd
/c/Users/gkvj4293/tmp

gkvj4293@SF-EISENMAN /c/Users/gkvj4293/tmp
$ fab prepare_deploy
/c
/c/Users/gkvj4293/tmp
/c
[localhost] local: pwd

Done.
====================================

Shouldn't local place me in my pwd?  I'm using pre-built python binaries.  My 
versions:

$ python --version
Python 2.7.3

$ fab --version
Fabric 1.4.2
ssh (library) 1.7.14

Perhaps Fabric should provide an option to set shell=False. 



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

Reply via email to