You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by pq...@apache.org on 2010/04/14 22:57:14 UTC
svn commit: r934197 - /incubator/libcloud/trunk/libcloud/drivers/slicehost.py
Author: pquerna
Date: Wed Apr 14 20:57:13 2010
New Revision: 934197
URL: http://svn.apache.org/viewvc?rev=934197&view=rev
Log:
Fix Slicehost Destroy node: Slicehost is returning a 1 byte response, with content type of XML, but no XML. This was breaking the ET parser when it couldn't parse it to an object.
Modified:
incubator/libcloud/trunk/libcloud/drivers/slicehost.py
Modified: incubator/libcloud/trunk/libcloud/drivers/slicehost.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/slicehost.py?rev=934197&r1=934196&r2=934197&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/slicehost.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/slicehost.py Wed Apr 14 20:57:13 2010
@@ -27,7 +27,9 @@ from xml.parsers.expat import ExpatError
class SlicehostResponse(Response):
def parse_body(self):
- if not self.body:
+ # length of 1 can't be valid XML, but on destroy node, slicehost returns
+ # a 1 byte response with a "Content-Type: application/xml" header. booya.
+ if not self.body or len(self.body) <= 1:
return None
return ET.XML(self.body)