Commit b6fa1f2f authored by Łukasz Nowak's avatar Łukasz Nowak

software/rapid-cdn: Protect more against unusal values

This part is unit tested against slapproxy, but unfortunately other
implementations of SlapOS Master might return None in such case failing
fully the profile.

Fix it without test, but with marking the problem.
parent 82d21446
......@@ -26,7 +26,7 @@ md5sum = 4a53b09ba4cbf15e32a5088cc81db5ea
[profile-master]
filename = instance-master.cfg.in
md5sum = 78c556911944339f0c03c8416db8dbaa
md5sum = fcc78c9f240974dff2ed5055a2675603
[profile-slave-list]
filename = instance-slave-list.cfg.in
......
......@@ -316,7 +316,9 @@ context =
{%- endfor %}
{%- for k in ['ssl_proxy_ca_crt', 'health-check-failover-ssl-proxy-ca-crt'] %}
{%- if k in slave %}
{%- set crt = slave.get(k, '') %}
{#- Be very cautious -- some master implementations are returning None for empty strings #}
{#- Thus get can return None so convert it to a string #}
{%- set crt = slave.get(k, '') or '' %}
{%- set check_popen = popen([software_parameter_dict['openssl'], 'x509', '-noout']) %}
{%- do check_popen.communicate(crt.encode()) %}
{%- if check_popen.returncode != 0 %}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment