Reputation: 22831
I've noticed some strange behavior in the local() command on Windows since upgrading Fabric (which I did because local wasn't working). The relevant bit of my fabfile looks like this:
env.hosts = ['server.com:22'] # One or multiple server addresses in format ip:port
env.path = '/code'
env.apache_path = '/apache'
env.user = 'user'
env.prj_name = 'user'
env.password = 'password'
def test():
local('python manage.py test measurements temperature results', capture=False)
Running fab test
used to fire off the typical Django test suite. It still does on my Mac. On Windows, it now claims to run the command and then stops with no actual testing. If I move the env information into a command (or just delete it), fab test
works as expected. Should this be the case? Does the env dictionary affect local()?
Fabric 1.3.3 on Windows 7, 32-bit Python
Upvotes: 2
Views: 2985
Reputation: 40374
When a local
function is called, the command that is passed is actually wrapped and prefixed with what is found in different env
variables (one of them, that I see in the question, is env.path
). Hence, the command that is finally executed, isn't exactly the command that was passed and there might be some configuration there that makes the command to fail.
To troubleshout this situation, make sure about what's the command that is really being executed using --show=debug
:
fab --show=debug <task>
Once you know exactly the command executed, you can probably reproduce the problem and find out what's really happening under the hood.
Upvotes: 3