Setting protocol for horizon API
The patch checks whether SSL is enabled for horizon and
set HTTPS or HTTP protocol to connect to API.
Change-Id: I1cd1add804fe93f4fe19785c4285e89c7e62ab4b
Related-PROD: PROD-25652
diff --git a/horizon/upgrade/verify/_api.sls b/horizon/upgrade/verify/_api.sls
index 17dfabf..3fbe394 100644
--- a/horizon/upgrade/verify/_api.sls
+++ b/horizon/upgrade/verify/_api.sls
@@ -8,9 +8,15 @@
{%- if server.get('enabled', false) %}
{%- set horizon_server = '127.0.0.1' if server.get('bind', {}).get('address') == '0.0.0.0' else server.get('bind', {}).get('address') %}
+{%- if pillar.get('apache',{}).get('server',{}).get('site',{}).get('horizon',{}).get('ssl',{}).get('enabled') == True %}
+ {%- set protocol = 'https' %}
+{%- else %}
+ {%- set protocol = 'http' %}
+{%- endif %}
+
horizon_http_listen:
http.query:
- - name: http://{{ horizon_server }}:{{ server.get('bind', {}).get('port', 80) }}
+ - name: {{ protocol }}://{{ horizon_server }}:{{ server.get('bind', {}).get('port', 80) }}
- status: 200
{%- endif %}