Merge lp:~rackspace-titan/nova/remove-toprettyxml-lp817580 into lp:~hudson-openstack/nova/trunk

Proposed by Brian Waldon
Status: Merged
Approved by: Brian Lamar
Approved revision: 1569
Merged at revision: 1573
Proposed branch: lp:~rackspace-titan/nova/remove-toprettyxml-lp817580
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 89 lines (+13/-19)
3 files modified
nova/api/openstack/wsgi.py (+1/-1)
nova/tests/api/openstack/test_images.py (+6/-10)
nova/tests/api/openstack/test_limits.py (+6/-8)
To merge this branch: bzr merge lp:~rackspace-titan/nova/remove-toprettyxml-lp817580
Reviewer Review Type Date Requested Status
Brian Lamar (community) Approve
Dan Prince (community) Approve
Mandell (community) community Approve
William Wolf (community) Approve
Review via email: mp+75377@code.launchpad.net

Description of the change

Removing toprettyxml from OSAPI xml serialization in favor of toxml.

To post a comment you must log in.
Revision history for this message
William Wolf (throughnothing) wrote :

Fantastic. lgtm.

Revision history for this message
William Wolf (throughnothing) :
review: Approve
Revision history for this message
Mandell (mdegerne) wrote :

lgtm

review: Approve (community)
Revision history for this message
Dan Prince (dan-prince) wrote :

Looks good.

review: Approve
Revision history for this message
Brian Lamar (blamar) wrote :

Good good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/api/openstack/wsgi.py'
2--- nova/api/openstack/wsgi.py 2011-08-25 20:35:04 +0000
3+++ nova/api/openstack/wsgi.py 2011-09-14 16:33:38 +0000
4@@ -316,7 +316,7 @@
5
6 def to_xml_string(self, node, has_atom=False):
7 self._add_xmlns(node, has_atom)
8- return node.toprettyxml(indent=' ', encoding='UTF-8')
9+ return node.toxml('UTF-8')
10
11 #NOTE (ameade): the has_atom should be removed after all of the
12 # xml serializers and view builders have been updated to the current
13
14=== modified file 'nova/tests/api/openstack/test_images.py'
15--- nova/tests/api/openstack/test_images.py 2011-09-13 18:00:20 +0000
16+++ nova/tests/api/openstack/test_images.py 2011-09-14 16:33:38 +0000
17@@ -224,12 +224,10 @@
18
19 expected = minidom.parseString("""
20 <itemNotFound code="404"
21- xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
22- <message>
23- Image not found.
24- </message>
25+ xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
26+ <message>Image not found.</message>
27 </itemNotFound>
28- """.replace(" ", ""))
29+ """.replace(" ", "").replace("\n", ""))
30
31 actual = minidom.parseString(response.body.replace(" ", ""))
32
33@@ -261,12 +259,10 @@
34 # because the element hasn't changed definition
35 expected = minidom.parseString("""
36 <itemNotFound code="404"
37- xmlns="http://docs.openstack.org/compute/api/v1.1">
38- <message>
39- Image not found.
40- </message>
41+ xmlns="http://docs.openstack.org/compute/api/v1.1">
42+ <message>Image not found.</message>
43 </itemNotFound>
44- """.replace(" ", ""))
45+ """.replace(" ", "").replace("\n", ""))
46
47 actual = minidom.parseString(response.body.replace(" ", ""))
48
49
50=== modified file 'nova/tests/api/openstack/test_limits.py'
51--- nova/tests/api/openstack/test_limits.py 2011-09-04 09:39:21 +0000
52+++ nova/tests/api/openstack/test_limits.py 2011-09-14 16:33:38 +0000
53@@ -174,12 +174,11 @@
54 response = request.get_response(self.controller)
55
56 expected = minidom.parseString("""
57- <limits
58- xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
59+ <limits xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
60 <rate/>
61 <absolute/>
62 </limits>
63- """.replace(" ", ""))
64+ """.replace(" ", "").replace("\n", ""))
65
66 body = minidom.parseString(response.body.replace(" ", ""))
67
68@@ -192,17 +191,16 @@
69 response = request.get_response(self.controller)
70
71 expected = minidom.parseString("""
72- <limits
73- xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
74+ <limits xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
75 <rate>
76 <limit URI="*" regex=".*" remaining="10" resetTime="0"
77- unit="MINUTE" value="10" verb="GET"/>
78+ unit="MINUTE" value="10" verb="GET"/>
79 <limit URI="*" regex=".*" remaining="5" resetTime="0"
80- unit="HOUR" value="5" verb="POST"/>
81+ unit="HOUR" value="5" verb="POST"/>
82 </rate>
83 <absolute/>
84 </limits>
85- """.replace(" ", ""))
86+ """.replace(" ", "").replace("\n", ""))
87 body = minidom.parseString(response.body.replace(" ", ""))
88
89 self.assertEqual(expected.toxml(), body.toxml())