From a7ab0396aae2dae0c1f177c51b2b79a43dec3d18 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Fri, 27 Jul 2012 10:15:19 -0700 Subject: Use prettyxml output minidom's toprettyxml doesn't render well so using etree instead Change-Id: Iad05d55cfb071b11cb6f6b30aa9f23f33fd8039c --- nova/api/ec2/apirequest.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nova/api') diff --git a/nova/api/ec2/apirequest.py b/nova/api/ec2/apirequest.py index ca1302fad..06c329ea7 100644 --- a/nova/api/ec2/apirequest.py +++ b/nova/api/ec2/apirequest.py @@ -21,6 +21,7 @@ APIRequest class """ import datetime +from lxml import etree # TODO(termie): replace minidom with etree from xml.dom import minidom @@ -96,6 +97,9 @@ class APIRequest(object): xml.appendChild(response_el) response = xml.toxml() + root = etree.fromstring(response) + response = etree.tostring(root, pretty_print=True) + xml.unlink() # Don't write private key to log -- cgit