libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r889110 - /incubator/libcloud/trunk/libcloud/drivers/rackspace.py
Date Thu, 10 Dec 2009 06:22:17 GMT
Author: pquerna
Date: Thu Dec 10 06:22:17 2009
New Revision: 889110

URL: http://svn.apache.org/viewvc?rev=889110&view=rev
Log:
improve error parsing, preserve the text (there isn't an <error> tag at all)

Submitted by: Ian Bicking <ianb colorstudy.com>

Modified:
    incubator/libcloud/trunk/libcloud/drivers/rackspace.py

Modified: incubator/libcloud/trunk/libcloud/drivers/rackspace.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/rackspace.py?rev=889110&r1=889109&r2=889110&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/rackspace.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/rackspace.py Thu Dec 10 06:22:17 2009
@@ -41,11 +41,13 @@
         # TODO: fixup, Rackspace only uses response codes really!
         try:
             object = ET.XML(self.body)
-            return "; ".join([ err.text
+            text = "; ".join([ err.text or ''
                                for err in
-                               object.findall('error') ])
+                               object.getiterator()
+                               if err.text])
         except ExpatError:
-            return self.body
+            text = self.body
+        return '%s %s %s' % (self.status, self.error, text)
 
 
 class RackspaceConnection(ConnectionUserAndKey):



Mime
View raw message