libcloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r908740 - /incubator/libcloud/trunk/libcloud/drivers/voxel.py
Date Wed, 10 Feb 2010 23:15:31 GMT
Author: pquerna
Date: Wed Feb 10 23:15:23 2010
New Revision: 908740

URL: http://svn.apache.org/viewvc?rev=908740&view=rev
Log:
detect invalid user/password and throw the correct exception

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

Modified: incubator/libcloud/trunk/libcloud/drivers/voxel.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/voxel.py?rev=908740&r1=908739&r2=908740&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/voxel.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/voxel.py Wed Feb 10 23:15:23 2010
@@ -46,7 +46,11 @@
         if not self.parsed:
             self.parsed = ET.XML(self.body)
         for err in self.parsed.findall('err'):
-            err_list.append("(%s) %s" % (err.get('code'), err.get('msg')))
+            code = err.get('code')
+            err_list.append("(%s) %s" % (code, err.get('msg')))
+            if code == "1":
+                # sucks, but only way to detect bad authentication tokens so far
+                raise InvalidCredsException(err_list[-1])
         return "\n".join(err_list)
 
     def success(self):



Mime
View raw message