[uwsgi] better if condition if file is not in pillar
authorArthur Lutz <arthur.lutz@logilab.fr>
Tue, 17 Jan 2017 17:41:19 +0100
changeset 103 4ea00d8c15d1
parent 102 6a34a4eb10ad
child 104 5ce3e4f5615e
[uwsgi] better if condition if file is not in pillar
cubicweb/uwsgi/init.sls
cubicweb/uwsgi/uwsgi.ini
--- a/cubicweb/uwsgi/init.sls	Wed Dec 14 15:12:19 2016 +0100
+++ b/cubicweb/uwsgi/init.sls	Tue Jan 17 17:41:19 2017 +0100
@@ -35,6 +35,7 @@
       - service: uwsgi
 
 {% if 'file' in  config.cwapp_uwsgi_options.keys() %}
+{% if config.cwapp_uwsgi_options.file %}
 deploy wsgiapp.py for {{ name }}:
   file.managed:
     - name: {{ config.cwapp_uwsgi_options.file }}
@@ -42,6 +43,7 @@
     - template: jinja
     - group: www-data
 {% endif %}
+{% endif %}
 
 /etc/cubicweb.d/{{ name }}/sources:
   file.managed:
--- a/cubicweb/uwsgi/uwsgi.ini	Wed Dec 14 15:12:19 2016 +0100
+++ b/cubicweb/uwsgi/uwsgi.ini	Tue Jan 17 17:41:19 2017 +0100
@@ -3,7 +3,7 @@
 http = 0.0.0.0:{{ config.cwapp.port|default('8080', true) }}
 env = CW_INSTANCE={{ name }}
 #env = CW_DEBUG=1
-{% if config.cwapp_uwsgi_options.file %}
+{% if 'file' in  config.cwapp_uwsgi_options.keys() and config.cwapp_uwsgi_options.file %}
 wsgi-file = {{ config.cwapp_uwsgi_options.file }}
 {% else %}
 module = cubicweb.pyramid:wsgi_application()