Commit 10f69193 authored by Łukasz Nowak's avatar Łukasz Nowak

kvm: Protected parameters passed in buildout

Parameters coming from the user can result in having incorrect buildout
profile so dumps them for safety.
parent 60f31cdd
......@@ -23,7 +23,7 @@ md5sum = ee6ce6d6b34bc9eb84139152770cb422
[template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in
md5sum = 28a00c28a972f42627849b25c2792abb
md5sum = 8a6c5555efd63ac7d471b8fdabb69f7e
[template-kvm-resilient]
filename = instance-kvm-resilient.cfg.jinja2
......@@ -31,7 +31,7 @@ md5sum = 7de5756f59ef7d823cd8ed33e6d15230
[template-kvm-import]
filename = instance-kvm-import.cfg.jinja2.in
md5sum = bd7e5db872b0dbe7716ec49c3907c401
md5sum = 3e7ff2ba85762ca47b5f90495d492570
[template-kvm-import-script]
filename = template/kvm-import.sh.jinja2
......@@ -39,7 +39,7 @@ md5sum = cd0008f1689dfca9b77370bc4d275b70
[template-kvm-export]
filename = instance-kvm-export.cfg.jinja2
md5sum = 9593809fca9fc8900754730be488966f
md5sum = c15f7600389b0c641622fcfdc42260d8
[template-kvm-export-script]
filename = template/kvm-export.sh.jinja2
......
......@@ -24,7 +24,7 @@ global-ipv6 = {{ ipv6 }}
[slap-parameter]
{% for k, v in slapparameter_dict.items() -%}
{{ k }} = {{ v }}
{{ k }} = {{ dumps(v) }}
{% endfor -%}
[request-common]
......@@ -135,14 +135,13 @@ config-document-host = ${apache-conf:ip}
config-document-port = ${apache-conf:port}
config-document-path = ${hash-code:passwd}
config-keyboard-layout-language = {{ dumps(kvm_parameter_dict.get('keyboard-layout-language', 'fr')) }}
{%- if 'boot-image-url-list' in kvm_parameter_dict %}
{#- play nice: if parameter was not constructed by the original request, do not send it at all #}
config-boot-image-url-list = {{ kvm_parameter_dict['boot-image-url-list'] }}
{%- endif %}
{%- if 'boot-image-url-select' in kvm_parameter_dict %}
{#- play nice: if parameter was not constructed by the original request, do not send it at all #}
config-boot-image-url-select = {{ kvm_parameter_dict['boot-image-url-select'] }}
{%- endif %}
{%- for k in ['boot-image-url-list', 'boot-image-url-select'] %}
{#- play nice - use parameter only if present #}
{%- if k in kvm_parameter_dict %}
{#- play safe - dumps value #}
config-{{ k }} = {{ dumps(kvm_parameter_dict[k]) }}
{%- endif %}
{%- endfor %}
config-type = cluster
{% set bootstrap_script_url = slapparameter_dict.get('bootstrap-script-url', kvm_parameter_dict.get('bootstrap-script-url', '')) -%}
......
......@@ -9,7 +9,7 @@ parts +=
[slap-parameter]
{% for k, v in slapparameter_dict.items() -%}
{{ k }} = {{ v }}
{{ k }} = {{ dumps(v) }}
{% endfor -%}
# Create the exporter executable, which is a simple shell script
......
......@@ -14,7 +14,7 @@ extends =
[slap-parameter]
{% for k, v in slapparameter_dict.items() -%}
{{ k }} = {{ v }}
{{ k }} = {{ dumps(v) }}
{% endfor -%}
[resilient-publish-connection-parameter]
......
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