mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-02 03:02:23 +02:00
Fix the supervisord template.
The script was relying on the presence of an environment variable, which is only set when the virtualenv is activated. But a virtualenv does not have to be activated to work (it's possible to call the python command directly). This fixes it by relying on `sys.executable` which should be correct at all times. Fixes #306
This commit is contained in:
parent
4ab8863eb2
commit
b581865873
3 changed files with 8 additions and 3 deletions
|
@ -6,7 +6,10 @@ This document describes changes between each past release.
|
||||||
2.1 (unreleased)
|
2.1 (unreleased)
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
- Nothing changed yet.
|
Fixed
|
||||||
|
=====
|
||||||
|
|
||||||
|
- Fix the generation of the supervisord template (#306)
|
||||||
|
|
||||||
|
|
||||||
2.0 (2017-12-27)
|
2.0 (2017-12-27)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[program:ihatemoney]
|
[program:ihatemoney]
|
||||||
command={{ venv_path }}/bin/gunicorn -c /etc/ihatemoney/gunicorn.conf.py ihatemoney.wsgi:application
|
command={{ bin_path }}/gunicorn -c /etc/ihatemoney/gunicorn.conf.py ihatemoney.wsgi:application
|
||||||
user=ihatemoney
|
user=ihatemoney
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
|
|
|
@ -49,9 +49,11 @@ class ConfigTemplate(Command):
|
||||||
os.path.join('conf-templates/', config_file) + '.j2'
|
os.path.join('conf-templates/', config_file) + '.j2'
|
||||||
).decode('utf-8')
|
).decode('utf-8')
|
||||||
|
|
||||||
|
bin_path = os.path.join(os.path.dirname(sys.executable))
|
||||||
|
|
||||||
print(Template(template_content).render(
|
print(Template(template_content).render(
|
||||||
pkg_path=os.path.abspath(os.path.dirname(__file__)),
|
pkg_path=os.path.abspath(os.path.dirname(__file__)),
|
||||||
venv_path=os.environ.get('VIRTUAL_ENV'),
|
bin_path=bin_path,
|
||||||
secret_key=self.gen_secret_key(),
|
secret_key=self.gen_secret_key(),
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue