libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r926946 - /incubator/libcloud/trunk/libcloud/drivers/softlayer.py
Date Wed, 24 Mar 2010 06:09:43 GMT
Author: pquerna
Date: Wed Mar 24 06:09:42 2010
New Revision: 926946

URL: http://svn.apache.org/viewvc?rev=926946&view=rev
Log:
Move the API prefix to a class variable, making it easier to set at runtime

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=926946&r1=926945&r2=926946&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/softlayer.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/softlayer.py Wed Mar 24 06:09:42 2010
@@ -22,8 +22,6 @@ import libcloud
 from libcloud.types import Provider, InvalidCredsException
 from libcloud.base import NodeDriver, Node, NodeLocation
 
-API_PREFIX = "http://api.service.softlayer.com/xmlrpc/v3"
-
 DATACENTERS = {
     'sea01': {'country': 'US'},
     'wdc01': {'country': 'US'},
@@ -41,16 +39,17 @@ class SoftLayerTransport(xmlrpclib.Trans
 
 class SoftLayerProxy(xmlrpclib.ServerProxy):
     transportCls = (SoftLayerTransport, SoftLayerSafeTransport)
+    API_PREFIX = "http://api.service.softlayer.com/xmlrpc/v3"
 
     def __init__(self, service, user_agent, verbose=0):
         cls = self.transportCls[0]
-        if API_PREFIX[:8] == "https://":
+        if SoftLayerProxy.API_PREFIX[:8] == "https://":
           cls = self.transportCls[1]
         t = cls(use_datetime=0)
         t.user_agent = user_agent
         xmlrpclib.ServerProxy.__init__(
             self,
-            uri="%s/%s" % (API_PREFIX, service),
+            uri="%s/%s" % (SoftLayerProxy.API_PREFIX, service),
             transport=t,
             verbose=verbose
         )



Mime
View raw message