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
Pipeline #15811 failed with stage
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
[instance-theia] [instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in _update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = 942e269192d284e563a84ae710c0595b md5sum = 09df701afb9a2e3927f42a71976bf03d
[instance] [instance]
_update_hash_filename_ = instance.cfg.in _update_hash_filename_ = instance.cfg.in
......
...@@ -140,7 +140,9 @@ return = domain secure_access ...@@ -140,7 +140,9 @@ return = domain secure_access
name = {{ parameter_dict['frontend-name'] }} name = {{ parameter_dict['frontend-name'] }}
software-url = {{ parameter_dict['frontend-sr'] }} software-url = {{ parameter_dict['frontend-sr'] }}
software-type = {{ parameter_dict['frontend-sr-type'] }} software-type = {{ parameter_dict['frontend-sr-type'] }}
{%- if parameter_dict.get('frontend-guid') %}
sla-instance_guid = {{ parameter_dict['frontend-guid'] }} sla-instance_guid = {{ parameter_dict['frontend-guid'] }}
{%- endif %}
{% if additional_frontend %} {% if additional_frontend %}
[remote-additional-frontend] [remote-additional-frontend]
...@@ -148,7 +150,9 @@ sla-instance_guid = {{ parameter_dict['frontend-guid'] }} ...@@ -148,7 +150,9 @@ sla-instance_guid = {{ parameter_dict['frontend-guid'] }}
name = {{ parameter_dict['additional-frontend-name'] }} name = {{ parameter_dict['additional-frontend-name'] }}
software-url = {{ parameter_dict['additional-frontend-sr'] }} software-url = {{ parameter_dict['additional-frontend-sr'] }}
software-type = {{ parameter_dict['additional-frontend-sr-type'] }} software-type = {{ parameter_dict['additional-frontend-sr-type'] }}
{%- if parameter_dict.get('additional-frontend-guid') %}
sla-instance_guid = {{ parameter_dict['additional-frontend-guid'] }} sla-instance_guid = {{ parameter_dict['additional-frontend-guid'] }}
{%- endif %}
{% endif %} {% endif %}
...@@ -444,11 +448,13 @@ template = ...@@ -444,11 +448,13 @@ template =
$${slapos-standalone-config:ipv6} \ $${slapos-standalone-config:ipv6} \
$${slapos-standalone-config:port} \ $${slapos-standalone-config:port} \
$${slapos-standalone-config:computer-id} \ $${slapos-standalone-config:computer-id} \
{% if parameter_dict.get('embedded-sr') %} \ {%- if parameter_dict.get('embedded-sr') %}
--sr='{{ parameter_dict['embedded-sr'] }}' \ --sr='{{ parameter_dict['embedded-sr'] }}' \
{%- if parameter_dict.get('embedded-sr-type') %}
--srtype='{{ parameter_dict['embedded-sr-type'] }}' \ --srtype='{{ parameter_dict['embedded-sr-type'] }}' \
{%- endif %}
--srparams='$${embedded-instance-parameters:rendered}' \ --srparams='$${embedded-instance-parameters:rendered}' \
{% endif %} \ {%- endif %}
$${slap-connection:server-url} \ $${slap-connection:server-url} \
$${slap-connection:computer-id} \ $${slap-connection:computer-id} \
$${slap-connection:partition-id} \ $${slap-connection:partition-id} \
......
...@@ -135,7 +135,7 @@ initialization = ...@@ -135,7 +135,7 @@ initialization =
standalone.request( standalone.request(
args.sr, args.sr,
"Embedded Instance", "Embedded Instance",
args.srtype or None, args.srtype,
partition_parameter_kw=params, 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