heat API : Escape JSON TemplateBody XML serialization
AWS API defines JSON templates returned inside XML "wrapper" this change escapes XML serialization of TemplateBody content ref #152 Change-Id: I7e38dd2010b03061979f0906b582f9461c85cabc Signed-off-by: Steven Hardy <shardy@redhat.com>
This commit is contained in:
parent
e09bd8e662
commit
d2487050b6
@ -446,7 +446,13 @@ class XMLResponseSerializer(object):
|
||||
elif isinstance(obj, dict):
|
||||
for key, value in obj.items():
|
||||
subelement = etree.SubElement(element, key)
|
||||
self.object_to_element(value, subelement)
|
||||
if key == "TemplateBody":
|
||||
# Escape serialization for TemplateBody key, as
|
||||
# AWS api defines JSON-template-inside-XML format
|
||||
# ref to GetTemplate AWS CFN API docs
|
||||
subelement.text = str(value)
|
||||
else:
|
||||
self.object_to_element(value, subelement)
|
||||
else:
|
||||
element.text = str(obj)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user