The path() context manager stopped working for the local() operation in Fabric 1.5. It was working under 1.4.3.
We use the path context manager to add our local virtualenv's bin directory to our fabfile. Assuming that the virtualenv is in './env' relative to the fabfile, here is a task that shows the bug:
@task
def test_path():
with path('env/bin', behavior='prepend'):
local('echo $PATH')
local('which pip')
Everything works under Fabric 1.4.3:
$ fab test_path
[localhost] local: echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
[localhost] local: which pip
env/bin/pip
Done.
It breaks under Fabric 1.5.0:
$ fab test_path
[localhost] local: echo $PATH
"env/bin":$PATH
[localhost] local: which pip
/bin/sh: 1: which: not found
Fatal error: local() encountered an error (return code 127) while executing 'which pip'
Aborting.
The path() context manager stopped working for the local() operation in Fabric 1.5. It was working under 1.4.3.
We use the path context manager to add our local virtualenv's bin directory to our fabfile. Assuming that the virtualenv is in './env' relative to the fabfile, here is a task that shows the bug:
Everything works under Fabric 1.4.3:
It breaks under Fabric 1.5.0: