libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1209934 - /libcloud/branches/py3k/libcloud/compute/drivers/rimuhosting.py
Date Sat, 03 Dec 2011 15:31:19 GMT
Author: tomaz
Date: Sat Dec  3 15:31:19 2011
New Revision: 1209934

URL: http://svn.apache.org/viewvc?rev=1209934&view=rev
Log:
keys() needs to be wrapped in a list().

Modified:
    libcloud/branches/py3k/libcloud/compute/drivers/rimuhosting.py

Modified: libcloud/branches/py3k/libcloud/compute/drivers/rimuhosting.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/rimuhosting.py?rev=1209934&r1=1209933&r2=1209934&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/rimuhosting.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/rimuhosting.py Sat Dec  3 15:31:19 2011
@@ -59,11 +59,12 @@ class RimuHostingResponse(JsonResponse):
     def parse_body(self):
         try:
             js = super(RimuHostingResponse, self).parse_body()
-            if js[js.keys()[0]]['response_type'] == "ERROR":
+            keys = list(js.keys())
+            if js[keys[0]]['response_type'] == "ERROR":
                 raise RimuHostingException(
-                    js[js.keys()[0]]['human_readable_message']
+                    js[keys[0]]['human_readable_message']
                 )
-            return js[js.keys()[0]]
+            return js[keys[0]]
         except KeyError:
             raise RimuHostingException('Could not parse body: %s'
                                        % (self.body))



Mime
View raw message