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
=== modified file 'nova/api/openstack/wsgi.py'
--- nova/api/openstack/wsgi.py 2011-08-25 20:35:04 +0000
+++ nova/api/openstack/wsgi.py 2011-09-14 16:33:38 +0000
@@ -316,7 +316,7 @@
316316
317 def to_xml_string(self, node, has_atom=False):317 def to_xml_string(self, node, has_atom=False):
318 self._add_xmlns(node, has_atom)318 self._add_xmlns(node, has_atom)
319 return node.toprettyxml(indent=' ', encoding='UTF-8')319 return node.toxml('UTF-8')
320320
321 #NOTE (ameade): the has_atom should be removed after all of the321 #NOTE (ameade): the has_atom should be removed after all of the
322 # xml serializers and view builders have been updated to the current322 # xml serializers and view builders have been updated to the current
323323
=== modified file 'nova/tests/api/openstack/test_images.py'
--- nova/tests/api/openstack/test_images.py 2011-09-13 18:00:20 +0000
+++ nova/tests/api/openstack/test_images.py 2011-09-14 16:33:38 +0000
@@ -224,12 +224,10 @@
224224
225 expected = minidom.parseString("""225 expected = minidom.parseString("""
226 <itemNotFound code="404"226 <itemNotFound code="404"
227 xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">227 xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
228 <message>228 <message>Image not found.</message>
229 Image not found.
230 </message>
231 </itemNotFound>229 </itemNotFound>
232 """.replace(" ", ""))230 """.replace(" ", "").replace("\n", ""))
233231
234 actual = minidom.parseString(response.body.replace(" ", ""))232 actual = minidom.parseString(response.body.replace(" ", ""))
235233
@@ -261,12 +259,10 @@
261 # because the element hasn't changed definition259 # because the element hasn't changed definition
262 expected = minidom.parseString("""260 expected = minidom.parseString("""
263 <itemNotFound code="404"261 <itemNotFound code="404"
264 xmlns="http://docs.openstack.org/compute/api/v1.1">262 xmlns="http://docs.openstack.org/compute/api/v1.1">
265 <message>263 <message>Image not found.</message>
266 Image not found.
267 </message>
268 </itemNotFound>264 </itemNotFound>
269 """.replace(" ", ""))265 """.replace(" ", "").replace("\n", ""))
270266
271 actual = minidom.parseString(response.body.replace(" ", ""))267 actual = minidom.parseString(response.body.replace(" ", ""))
272268
273269
=== modified file 'nova/tests/api/openstack/test_limits.py'
--- nova/tests/api/openstack/test_limits.py 2011-09-04 09:39:21 +0000
+++ nova/tests/api/openstack/test_limits.py 2011-09-14 16:33:38 +0000
@@ -174,12 +174,11 @@
174 response = request.get_response(self.controller)174 response = request.get_response(self.controller)
175175
176 expected = minidom.parseString("""176 expected = minidom.parseString("""
177 <limits177 <limits xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
178 xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
179 <rate/>178 <rate/>
180 <absolute/>179 <absolute/>
181 </limits>180 </limits>
182 """.replace(" ", ""))181 """.replace(" ", "").replace("\n", ""))
183182
184 body = minidom.parseString(response.body.replace(" ", ""))183 body = minidom.parseString(response.body.replace(" ", ""))
185184
@@ -192,17 +191,16 @@
192 response = request.get_response(self.controller)191 response = request.get_response(self.controller)
193192
194 expected = minidom.parseString("""193 expected = minidom.parseString("""
195 <limits194 <limits xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
196 xmlns="http://docs.rackspacecloud.com/servers/api/v1.0">
197 <rate>195 <rate>
198 <limit URI="*" regex=".*" remaining="10" resetTime="0"196 <limit URI="*" regex=".*" remaining="10" resetTime="0"
199 unit="MINUTE" value="10" verb="GET"/>197 unit="MINUTE" value="10" verb="GET"/>
200 <limit URI="*" regex=".*" remaining="5" resetTime="0"198 <limit URI="*" regex=".*" remaining="5" resetTime="0"
201 unit="HOUR" value="5" verb="POST"/>199 unit="HOUR" value="5" verb="POST"/>
202 </rate>200 </rate>
203 <absolute/>201 <absolute/>
204 </limits>202 </limits>
205 """.replace(" ", ""))203 """.replace(" ", "").replace("\n", ""))
206 body = minidom.parseString(response.body.replace(" ", ""))204 body = minidom.parseString(response.body.replace(" ", ""))
207205
208 self.assertEqual(expected.toxml(), body.toxml())206 self.assertEqual(expected.toxml(), body.toxml())