我正在尝试使用pip.installed
或virtualenv.managed
状态来设置virtualenv,使用生活在minion上的需求文件(由早期的git.latest
状态安装) 。这是使用pip.installed
的版本:
mysite-env:
virtualenv.managed:
- name: /opt/django/mysite
- cwd: /opt/django/mysite
- user: mysite
- runas: mysite
- system_site_packages: True
mysite-reqs:
pip.installed:
- no_index: True
- find_links: http://pypi.mysite.com/
- requirements: /opt/django/mysite/requirements/production.txt
- pip_exists_action: switch
- cwd: /opt/django/mysite
- pip_bin: /opt/django/mysite/bin/pip
- bin_env: /opt/django/mysite
- user: mysite
- watch:
- git: mysite-project
当我尝试运行此状态时,我收到此错误:
ID: mysite-reqs
Function: pip.installed
Result: False
Comment: Unable to process requirements file /opt/django/mysite/requirements/production.txt. Error: Ignoring indexes: https://pypi.python.org/simple/
Could not open requirements file: [Errno 2] No such file or directory: '/tmp/requirements.txt'
Storing debug log for failure in /home/mysite/.pip/pip.log
但那不是我要求的路径。这看起来有点像bug,可能/tmp/requirements.txt
是硬编码的,因为它希望我使用salt://
URL而不是本地文件路径。
我做错了吗?这是一个错误,有没有一种解决它的好方法?
答案 0 :(得分:4)
这是我使用Saltstack和Python的第一天,我在google搜索环境配置帮助,并在我的搜索结果中遇到了您的问题。
我点击的下一个search result包含与您相同的错误,并建议这是由SaltStack将环境移至/ tmp以进行chowning引起的。
解决方案是将以下内容添加到您的盐状态:
no_chown: True
希望它有所帮助。