From 34a08d831418b934f4cceaae69dbf17d90ecd5e0 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 14 Sep 2011 12:32:00 -0400 Subject: removing toprettyxml --- nova/api/openstack/wsgi.py | 2 +- nova/tests/api/openstack/test_images.py | 16 ++++++---------- nova/tests/api/openstack/test_limits.py | 14 ++++++-------- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index bdcadcb99..588fc030b 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -316,7 +316,7 @@ class XMLDictSerializer(DictSerializer): def to_xml_string(self, node, has_atom=False): self._add_xmlns(node, has_atom) - return node.toprettyxml(indent=' ', encoding='UTF-8') + return node.toxml('UTF-8') #NOTE (ameade): the has_atom should be removed after all of the # xml serializers and view builders have been updated to the current diff --git a/nova/tests/api/openstack/test_images.py b/nova/tests/api/openstack/test_images.py index 2aee1bc14..32ae7eeec 100644 --- a/nova/tests/api/openstack/test_images.py +++ b/nova/tests/api/openstack/test_images.py @@ -224,12 +224,10 @@ class ImagesTest(test.TestCase): expected = minidom.parseString(""" - - Image not found. - + xmlns="http://docs.rackspacecloud.com/servers/api/v1.0"> + Image not found. - """.replace(" ", "")) + """.replace(" ", "").replace("\n", "")) actual = minidom.parseString(response.body.replace(" ", "")) @@ -261,12 +259,10 @@ class ImagesTest(test.TestCase): # because the element hasn't changed definition expected = minidom.parseString(""" - - Image not found. - + xmlns="http://docs.openstack.org/compute/api/v1.1"> + Image not found. - """.replace(" ", "")) + """.replace(" ", "").replace("\n", "")) actual = minidom.parseString(response.body.replace(" ", "")) diff --git a/nova/tests/api/openstack/test_limits.py b/nova/tests/api/openstack/test_limits.py index 3db57ee86..6f0210c27 100644 --- a/nova/tests/api/openstack/test_limits.py +++ b/nova/tests/api/openstack/test_limits.py @@ -174,12 +174,11 @@ class LimitsControllerV10Test(BaseLimitTestSuite): response = request.get_response(self.controller) expected = minidom.parseString(""" - + - """.replace(" ", "")) + """.replace(" ", "").replace("\n", "")) body = minidom.parseString(response.body.replace(" ", "")) @@ -192,17 +191,16 @@ class LimitsControllerV10Test(BaseLimitTestSuite): response = request.get_response(self.controller) expected = minidom.parseString(""" - + + unit="MINUTE" value="10" verb="GET"/> + unit="HOUR" value="5" verb="POST"/> - """.replace(" ", "")) + """.replace(" ", "").replace("\n", "")) body = minidom.parseString(response.body.replace(" ", "")) self.assertEqual(expected.toxml(), body.toxml()) -- cgit