Encode user-supplied metadata as json

We need to perform json encoding on these values because they may
contain characters like newlines or quotes, etc.

Change-Id: I84a17a97e7a245c92e7d91c85ce86277aef22d2e
This commit is contained in:
Gregory Haynes 2015-08-07 15:47:24 +00:00
parent 1288310c8c
commit 7bd82ddd70

View File

@ -10,11 +10,11 @@
{% else %}
"files": [],
{% endif %}
"hostname": "{{ name }}",
"name": "{{ name }}",
"hostname": {{ name|to_json }},
"name": {{ name|to_json }},
"meta": {},
"public_keys": {
"mykey": "{{ ssh_public_key }}"
"mykey": {{ ssh_public_key|to_json }}
},
"uuid": "{{ uuid }}"
}