python - lcd context switcher is not working in fabric -
i'm running django python3.2, , discovered fabric doesn't back upwards python3.
so created sec virtual environment (fabric-env) run fabric out of.
here's fab --version output virtualenv:
fabric 1.9.0 paramiko 1.14.0 python --version
python 2.7.3 my fab file looks (only relevant lines):
from fabric.api import local def deploy(branch_name): lcd('/var/www/finance'): local('git pull /home/user1/dev/' + branch_name) local('/var/www/finance/finance-env/bin/python3 manage.py test corefinance') local('/var/www/finance/finance-env/bin/python3 manage.py schemamigration corefinance --auto') local('/var/www/finance/finance-env/bin/python3 manage.py migrate corefinance') local('sudo service apache2 restart') when run deploy function, i'm getting next error:
file "/var/www/finance/fabfile.py", line 19, in deploy lcd('/var/www/finance'): nameerror: global name 'lcd' not defined the fabric documentation says function should available. appears both fabric , python recent plenty ( sure fabric not trying run off of different python, ran function both within , outside virtual environment).
no hits on google error message...
you have not imported lcd. add together next top of file:
from fabric.context_managers import lcd python fabric
No comments:
Post a Comment