libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1209967 - in /libcloud/branches/py3k/libcloud: ./ common/ compute/drivers/ storage/drivers/
Date Sat, 03 Dec 2011 18:27:48 GMT
Author: tomaz
Date: Sat Dec  3 18:27:47 2011
New Revision: 1209967

URL: http://svn.apache.org/viewvc?rev=1209967&view=rev
Log:
Export if under different names.

Modified:
    libcloud/branches/py3k/libcloud/common/base.py
    libcloud/branches/py3k/libcloud/common/cloudstack.py
    libcloud/branches/py3k/libcloud/common/openstack.py
    libcloud/branches/py3k/libcloud/compute/drivers/bluebox.py
    libcloud/branches/py3k/libcloud/compute/drivers/ec2.py
    libcloud/branches/py3k/libcloud/compute/drivers/ibm_sbc.py
    libcloud/branches/py3k/libcloud/py3.py
    libcloud/branches/py3k/libcloud/storage/drivers/atmos.py
    libcloud/branches/py3k/libcloud/storage/drivers/cloudfiles.py
    libcloud/branches/py3k/libcloud/storage/drivers/s3.py

Modified: libcloud/branches/py3k/libcloud/common/base.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/common/base.py?rev=1209967&r1=1209966&r2=1209967&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/common/base.py (original)
+++ libcloud/branches/py3k/libcloud/common/base.py Sat Dec  3 18:27:47 2011
@@ -29,6 +29,7 @@ import libcloud
 from libcloud.py3 import urllib
 from libcloud.py3 import httplib
 from libcloud.py3 import urlparse
+from libcloud.py3 import urlencode
 from libcloud.py3 import StringIO
 from libcloud.py3 import u
 
@@ -467,7 +468,7 @@ class Connection(object):
         params, headers = self.pre_connect_hook(params, headers)
 
         if params:
-            url = '?'.join((action, urllib.urlencode(params)))
+            url = '?'.join((action, urlencode(params)))
         else:
             url = action
 

Modified: libcloud/branches/py3k/libcloud/common/cloudstack.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/common/cloudstack.py?rev=1209967&r1=1209966&r2=1209967&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/common/cloudstack.py (original)
+++ libcloud/branches/py3k/libcloud/common/cloudstack.py Sat Dec  3 18:27:47 2011
@@ -16,9 +16,8 @@
 import base64
 import hashlib
 import hmac
-import time
 
-from libcloud.py3 import urllib
+from libcloud.py3 import urlencode
 from libcloud.py3 import b
 
 from libcloud.common.base import ConnectionUserAndKey, PollingConnection
@@ -40,7 +39,7 @@ class CloudStackConnection(ConnectionUse
     def _make_signature(self, params):
         signature = [(k.lower(), v) for k, v in params.items()]
         signature.sort(key=lambda x: x[0])
-        signature = urllib.urlencode(signature)
+        signature = urlencode(signature)
         signature = signature.lower().replace('+', '%20')
         signature = hmac.new(b(self.key), msg=b(signature), digestmod=hashlib.sha1)
         return base64.b64encode(b(signature.digest()))

Modified: libcloud/branches/py3k/libcloud/common/openstack.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/common/openstack.py?rev=1209967&r1=1209966&r2=1209967&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/common/openstack.py (original)
+++ libcloud/branches/py3k/libcloud/common/openstack.py Sat Dec  3 18:27:47 2011
@@ -19,7 +19,6 @@ Common utilities for OpenStack
 import sys
 
 from libcloud.py3 import httplib
-from libcloud.py3 import urllib2
 from libcloud.py3 import urlparse
 
 from libcloud.common.base import ConnectionUserAndKey, Response

Modified: libcloud/branches/py3k/libcloud/compute/drivers/bluebox.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/bluebox.py?rev=1209967&r1=1209966&r2=1209967&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/bluebox.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/bluebox.py Sat Dec  3 18:27:47 2011
@@ -26,6 +26,7 @@ import copy
 from libcloud.py3 import urllib
 import base64
 
+from libcloud.py3 import urlencode
 from libcloud.py3 import b
 
 from libcloud.common.base import JsonResponse, ConnectionUserAndKey
@@ -185,7 +186,7 @@ class BlueboxNodeDriver(NodeDriver):
         if not ssh and not password:
             raise Exception("SSH public key or password required.")
 
-        params = urllib.urlencode(data)
+        params = urlencode(data)
         result = self.connection.request('/api/blocks.json', headers=headers, data=params,
method='POST')
         node = self._to_node(result.object)
         return node

Modified: libcloud/branches/py3k/libcloud/compute/drivers/ec2.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/ec2.py?rev=1209967&r1=1209966&r2=1209967&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/ec2.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/ec2.py Sat Dec  3 18:27:47 2011
@@ -28,7 +28,7 @@ import copy
 from hashlib import sha256
 from xml.etree import ElementTree as ET
 
-from libcloud.py3 import urllib
+from libcloud.py3 import urlquote
 from libcloud.py3 import b
 
 from libcloud.utils import fixxpath, findtext, findattr, findall
@@ -233,8 +233,8 @@ class EC2Connection(ConnectionUserAndKey
         keys.sort()
         pairs = []
         for key in keys:
-            pairs.append(urllib.quote(key, safe='') + '=' +
-                         urllib.quote(params[key], safe='-_~'))
+            pairs.append(urlquote(key, safe='') + '=' +
+                         urlquote(params[key], safe='-_~'))
 
         qs = '&'.join(pairs)
 

Modified: libcloud/branches/py3k/libcloud/compute/drivers/ibm_sbc.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/compute/drivers/ibm_sbc.py?rev=1209967&r1=1209966&r2=1209967&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/compute/drivers/ibm_sbc.py (original)
+++ libcloud/branches/py3k/libcloud/compute/drivers/ibm_sbc.py Sat Dec  3 18:27:47 2011
@@ -17,6 +17,7 @@ Driver for the IBM Developer Cloud.
 """
 import base64, urllib
 
+from libcloud.py3 import urlencode
 from libcloud.py3 import b
 
 from libcloud.common.base import XmlResponse, ConnectionUserAndKey
@@ -56,7 +57,7 @@ class IBMConnection(ConnectionUserAndKey
         return headers
 
     def encode_data(self, data):
-        return urllib.urlencode(data)
+        return urlencode(data)
 
 class IBMNodeDriver(NodeDriver):
     """

Modified: libcloud/branches/py3k/libcloud/py3.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/py3.py?rev=1209967&r1=1209966&r2=1209967&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/py3.py (original)
+++ libcloud/branches/py3k/libcloud/py3.py Sat Dec  3 18:27:47 2011
@@ -27,13 +27,12 @@ if sys.version_info >= (3, 0):
     PY3 = True
     import http.client as httplib
     from io import StringIO
+    import urllib
     import urllib as urllib2
     import urllib.parse as urlparse
     import xmlrpc.client as xmlrpclib
-
-    import urllib
-    urllib.quote = urlparse.quote
-    urllib.urlencode = urlparse.urlencode
+    from urllib.parse import quote as urlquote
+    from urllib.parse import urlencode as urlencode
 
     basestring = str
 
@@ -63,6 +62,8 @@ else:
     import urllib2
     import urlparse
     import xmlrpclib
+    from urllib import quote as urlquote
+    from urllib import urlencode as urlencode
 
     basestring = unicode = str
 

Modified: libcloud/branches/py3k/libcloud/storage/drivers/atmos.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/storage/drivers/atmos.py?rev=1209967&r1=1209966&r2=1209967&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/storage/drivers/atmos.py (original)
+++ libcloud/branches/py3k/libcloud/storage/drivers/atmos.py Sat Dec  3 18:27:47 2011
@@ -23,6 +23,7 @@ from libcloud.py3 import PY3
 from libcloud.py3 import httplib
 from libcloud.py3 import urllib
 from libcloud.py3 import urlparse
+from libcloud.py3 import urlencode
 from libcloud.py3 import next
 from libcloud.py3 import b
 
@@ -90,7 +91,7 @@ class AtmosConnection(ConnectionUserAndK
         if params:
             if type(params) is dict:
                 params = params.items()
-            pathstring += '?' + urllib.urlencode(params)
+            pathstring += '?' + urlencode(params)
         pathstring = pathstring.lower()
 
         xhdrs = [(k, v) for k, v in headers.items() if k.startswith('x-emc-')]
@@ -370,7 +371,7 @@ class AtmosDriver(StorageDriver):
         ]
         params.append(('signature', self._cdn_signature(path, params)))
 
-        params = urllib.urlencode(params)
+        params = urlencode(params)
         path = self.path + path
         return urlparse.urlunparse((protocol, self.host, path, '', params, ''))
 

Modified: libcloud/branches/py3k/libcloud/storage/drivers/cloudfiles.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/storage/drivers/cloudfiles.py?rev=1209967&r1=1209966&r2=1209967&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/storage/drivers/cloudfiles.py (original)
+++ libcloud/branches/py3k/libcloud/storage/drivers/cloudfiles.py Sat Dec  3 18:27:47 2011
@@ -22,6 +22,7 @@ except ImportError:
     import json
 
 from libcloud.py3 import PY3
+from libcloud.py3 import urlquote
 
 if PY3:
     from io import FileIO as file
@@ -436,7 +437,7 @@ class CloudFilesStorageDriver(StorageDri
         """
         if name.startswith('/'):
             name = name[1:]
-        name = urllib.quote(name)
+        name = urlquote(name)
 
         if name.find('/') != -1:
             raise InvalidContainerNameError(value='Container name cannot'
@@ -452,7 +453,7 @@ class CloudFilesStorageDriver(StorageDri
         return name
 
     def _clean_object_name(self, name):
-        name = urllib.quote(name)
+        name = urlquote(name)
         return name
 
     def _to_container_list(self, response):

Modified: libcloud/branches/py3k/libcloud/storage/drivers/s3.py
URL: http://svn.apache.org/viewvc/libcloud/branches/py3k/libcloud/storage/drivers/s3.py?rev=1209967&r1=1209966&r2=1209967&view=diff
==============================================================================
--- libcloud/branches/py3k/libcloud/storage/drivers/s3.py (original)
+++ libcloud/branches/py3k/libcloud/storage/drivers/s3.py Sat Dec  3 18:27:47 2011
@@ -24,6 +24,7 @@ from xml.etree.ElementTree import Elemen
 from libcloud.py3 import PY3
 from libcloud.py3 import httplib
 from libcloud.py3 import urllib
+from libcloud.py3 import urlquote
 from libcloud.py3 import b
 
 from libcloud.utils import fixxpath, findtext, in_development_warning
@@ -337,7 +338,7 @@ class S3StorageDriver(StorageDriver):
         return False
 
     def _clean_object_name(self, name):
-        name = urllib.quote(name)
+        name = urlquote(name)
         return name
 
     def _get_more(self, last_key, value_dict):



Mime
View raw message