Vye
unread,May 19, 2014, 5:33:51 PM5/19/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to salt-...@googlegroups.com
Is there a way to modify environment variables such as PATH and
LD_LIBRARY_PATH for modules pip and virtualenv? I believe the
functionality I'm looking for is supplied by modules.environ but I'm
using 2014.1 which it is not included in.
I want to create a virtualenv from an optional Python installed in
/opt/rh/python27 (RHEL).
/srv/www/app/venv:
virtualenv.managed:
- python: PATH=/opt/rh/python27/root/usr/bin${PATH:+:${PATH}}
LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
python2.7
- use_wheel: True
- requirements: /srv/www/app/requirements.txt
produces the following error:
ID: /srv/www/app/venv
Function: virtualenv.managed
Result: False
Comment: An exception occurred in this state: Traceback (most
recent call last):
File "/usr/lib/python2.6/site-packages/salt/state.py",
line 1371, in call
**cdata['kwargs'])
File
"/usr/lib/python2.6/site-packages/salt/states/virtualenv_mod.py", line
166, in managed
user=user
File
"/usr/lib/python2.6/site-packages/salt/modules/virtualenv_mod.py",
line 203, in create
'executable.'.format(python)
CommandExecutionError: Requested python
(PATH=/opt/rh/python27/root/usr/bin${PATH:+:${PATH}}
LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
python2.7) does not appear executable.
I could avoid setting PATH by using the absolute path but
LD_LIBRARY_PATH still needs to be set so Python can find the
libraries. What's the best way to accomplish this?
--
-Vye