libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r926942 - /incubator/libcloud/trunk/libcloud/drivers/softlayer.py
Date Wed, 24 Mar 2010 05:55:07 GMT
Author: pquerna
Date: Wed Mar 24 05:55:07 2010
New Revision: 926942

URL: http://svn.apache.org/viewvc?rev=926942&view=rev
Log:
Correctly throw InvalidCredsException if you pass a wrong user/password

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

Modified: incubator/libcloud/trunk/libcloud/drivers/softlayer.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/softlayer.py?rev=926942&r1=926941&r2=926942&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/softlayer.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/softlayer.py Wed Mar 24 05:55:07 2010
@@ -19,7 +19,7 @@ Softlayer driver
 import xmlrpclib
 
 import libcloud
-from libcloud.types import Provider
+from libcloud.types import Provider, InvalidCredsException
 from libcloud.base import NodeDriver, Node, NodeLocation
 
 API_PREFIX = "http://api.service.softlayer.com/xmlrpc/v3"
@@ -33,7 +33,7 @@ DATACENTERS = {
 class SoftLayerException(Exception):
     pass
 
-class SoftLayerTransport(xmlrpclib.Transport):
+class SoftLayerTransport(xmlrpclib.SafeTransport):
     user_agent = "libcloud/%s (SoftLayer)" % libcloud.__version__
 
 class SoftLayerProxy(xmlrpclib.ServerProxy):
@@ -61,6 +61,8 @@ class SoftLayerConnection(object):
         try:
             return getattr(sl, method)(*params)
         except xmlrpclib.Fault, e:
+            if e.faultCode == "SoftLayer_Account":
+                raise InvalidCredsException(e.faultString)
             raise SoftLayerException(e)
 
     def _get_auth_param(self, service, init_params=None):



Mime
View raw message