Commit c60456d3 authored by Xavier Thompson's avatar Xavier Thompson

software/theia: Fix null parameters templating

Before this commit, instance parameters that have a default null value
in JSON format were rendered as 'None' string in instance-theia.cfg.

In particular, Theia frontends were always requested with unsolvable
SLA parameters that prevented a frontend from ever being allocated:
```
sla-instance_guid = None
```
parent 07b02216
......@@ -15,7 +15,7 @@
[instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = 942e269192d284e563a84ae710c0595b
md5sum = 09df701afb9a2e3927f42a71976bf03d
[instance]
_update_hash_filename_ = instance.cfg.in
......
......@@ -140,7 +140,9 @@ return = domain secure_access
name = {{ parameter_dict['frontend-name'] }}
software-url = {{ parameter_dict['frontend-sr'] }}
software-type = {{ parameter_dict['frontend-sr-type'] }}
{%- if parameter_dict.get('frontend-guid') %}
sla-instance_guid = {{ parameter_dict['frontend-guid'] }}
{%- endif %}
{% if additional_frontend %}
[remote-additional-frontend]
......@@ -148,7 +150,9 @@ sla-instance_guid = {{ parameter_dict['frontend-guid'] }}
name = {{ parameter_dict['additional-frontend-name'] }}
software-url = {{ parameter_dict['additional-frontend-sr'] }}
software-type = {{ parameter_dict['additional-frontend-sr-type'] }}
{%- if parameter_dict.get('additional-frontend-guid') %}
sla-instance_guid = {{ parameter_dict['additional-frontend-guid'] }}
{%- endif %}
{% endif %}
......@@ -444,11 +448,13 @@ template =
$${slapos-standalone-config:ipv6} \
$${slapos-standalone-config:port} \
$${slapos-standalone-config:computer-id} \
{% if parameter_dict.get('embedded-sr') %} \
{%- if parameter_dict.get('embedded-sr') %}
--sr='{{ parameter_dict['embedded-sr'] }}' \
{%- if parameter_dict.get('embedded-sr-type') %}
--srtype='{{ parameter_dict['embedded-sr-type'] }}' \
{%- endif %}
--srparams='$${embedded-instance-parameters:rendered}' \
{% endif %} \
{%- endif %}
$${slap-connection:server-url} \
$${slap-connection:computer-id} \
$${slap-connection:partition-id} \
......
......@@ -135,7 +135,7 @@ initialization =
standalone.request(
args.sr,
"Embedded Instance",
args.srtype or None,
args.srtype,
partition_parameter_kw=params,
)
......
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