You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2014/03/30 22:56:29 UTC
[1/4] git commit: Fix for various PEP8 errors.
Repository: libcloud
Updated Branches:
refs/heads/trunk 121daef80 -> 95b6a68ad
Fix for various PEP8 errors.
Fix some visual alignments errors reported by pep8.
Signed-off-by: Tomaz Muraus <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/95b6a68a
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/95b6a68a
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/95b6a68a
Branch: refs/heads/trunk
Commit: 95b6a68adb5cbbe071d9da509484146cff6c5626
Parents: 51af25e
Author: Franck Cuny <fr...@gmail.com>
Authored: Sun Mar 30 11:22:15 2014 -0700
Committer: Tomaz Muraus <to...@apache.org>
Committed: Sun Mar 30 22:55:41 2014 +0200
----------------------------------------------------------------------
libcloud/compute/drivers/cloudsigma.py | 18 ++++++++++--------
libcloud/compute/drivers/ec2.py | 6 +++---
libcloud/compute/drivers/openstack.py | 6 +++---
libcloud/compute/drivers/opsource.py | 4 ++--
libcloud/compute/drivers/rimuhosting.py | 3 +--
libcloud/pricing.py | 2 +-
libcloud/storage/base.py | 4 ++--
libcloud/test/compute/test_vcloud.py | 7 ++++---
libcloud/test/loadbalancer/test_rackspace.py | 2 +-
9 files changed, 27 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b6a68a/libcloud/compute/drivers/cloudsigma.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudsigma.py b/libcloud/compute/drivers/cloudsigma.py
index ccad8b1..5d97434 100644
--- a/libcloud/compute/drivers/cloudsigma.py
+++ b/libcloud/compute/drivers/cloudsigma.py
@@ -145,7 +145,7 @@ class CloudSigma_1_0_NodeDriver(CloudSigmaNodeDriver):
connectionCls = CloudSigma_1_0_Connection
IMAGING_TIMEOUT = 20 * 60 # Default timeout (in seconds) for the drive
- # imaging process
+ # imaging process
NODE_STATE_MAP = {
'active': NodeState.RUNNING,
@@ -974,11 +974,12 @@ class CloudSigma_2_0_NodeDriver(CloudSigmaNodeDriver):
website = 'http://www.cloudsigma.com/'
connectionCls = CloudSigma_2_0_Connection
- DRIVE_TRANSITION_TIMEOUT = 500 # Default drive transition timeout in
- # seconds
- DRIVE_TRANSITION_SLEEP_INTERVAL = 5 # How long to sleep between different
- # polling periods while waiting for
- # drive transition
+ # Default drive transition timeout in seconds
+ DRIVE_TRANSITION_TIMEOUT = 500
+
+ # How long to sleep between different polling periods while waiting for
+ # drive transition
+ DRIVE_TRANSITION_SLEEP_INTERVAL = 5
NODE_STATE_MAP = {
'starting': NodeState.PENDING,
@@ -1106,8 +1107,9 @@ class CloudSigma_2_0_NodeDriver(CloudSigmaNodeDriver):
vnc_password = get_secure_random_string(size=12)
drive_name = '%s-drive' % (name)
- drive_size = (size.disk * 1024 * 1024 * 1024) # size is specified in
- # GB
+
+ # size is specified in GB
+ drive_size = (size.disk * 1024 * 1024 * 1024)
if not is_installation_cd:
# 1. Clone library drive so we can use it
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b6a68a/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index e2899f1..4d75fa3 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -3593,9 +3593,9 @@ class BaseEC2NodeDriver(NodeDriver):
'private_dns': findtext(element=item,
xpath='privateDnsName',
namespace=NAMESPACE),
- 'primary': findtext(element=item,
- xpath='primary',
- namespace=NAMESPACE)})
+ 'primary': findtext(element=item,
+ xpath='primary',
+ namespace=NAMESPACE)})
# Build our attachment dictionary which we will add into extra later
attributes_map = \
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b6a68a/libcloud/compute/drivers/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py
index 83a5dad..38223ee 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -861,8 +861,7 @@ class OpenStack_1_0_NodeDriver(OpenStackNodeDriver):
'uri': "https://%s%s/servers/%s" % (
self.connection.host,
self.connection.request_path, el.get('id')),
- 'metadata': metadata,
- })
+ 'metadata': metadata})
return n
def _to_sizes(self, object):
@@ -1022,7 +1021,8 @@ class OpenStackNetwork(object):
def __repr__(self):
return '<OpenStackNetwork id="%s" name="%s" cidr="%s">' % (self.id,
- self.name, self.cidr,)
+ self.name,
+ self.cidr,)
class OpenStackSecurityGroup(object):
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b6a68a/libcloud/compute/drivers/opsource.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/opsource.py b/libcloud/compute/drivers/opsource.py
index a2024c3..9d43ca4 100644
--- a/libcloud/compute/drivers/opsource.py
+++ b/libcloud/compute/drivers/opsource.py
@@ -359,8 +359,8 @@ class OpsourceNodeDriver(NodeDriver):
@inherits: :class:`NodeDriver.list_images`
"""
- return self._to_base_images(self.connection.request('base/image')
- .object)
+ return self._to_base_images(
+ self.connection.request('base/image').object)
def list_sizes(self, location=None):
return [
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b6a68a/libcloud/compute/drivers/rimuhosting.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/rimuhosting.py b/libcloud/compute/drivers/rimuhosting.py
index ebe6bc9..edb344b 100644
--- a/libcloud/compute/drivers/rimuhosting.py
+++ b/libcloud/compute/drivers/rimuhosting.py
@@ -159,8 +159,7 @@ class RimuHostingNodeDriver(NodeDriver):
state=NodeState.RUNNING,
public_ips=(
[order['allocated_ips']['primary_ip']]
- + order['allocated_ips']['secondary_ips']
- ),
+ + order['allocated_ips']['secondary_ips']),
private_ips=[],
driver=self.connection.driver,
extra={
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b6a68a/libcloud/pricing.py
----------------------------------------------------------------------
diff --git a/libcloud/pricing.py b/libcloud/pricing.py
index abf71e6..ebe99a8 100644
--- a/libcloud/pricing.py
+++ b/libcloud/pricing.py
@@ -189,7 +189,7 @@ def download_pricing_file(file_url=DEFAULT_FILE_URL,
if not os.path.exists(dir_name):
# Verify a valid path is provided
msg = ('Can\'t write to %s, directory %s, doesn\'t exist' %
- (file_path, dir_name))
+ (file_path, dir_name))
raise ValueError(msg)
if os.path.exists(file_path) and os.path.isdir(file_path):
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b6a68a/libcloud/storage/base.py
----------------------------------------------------------------------
diff --git a/libcloud/storage/base.py b/libcloud/storage/base.py
index b5e88ff..136d701 100644
--- a/libcloud/storage/base.py
+++ b/libcloud/storage/base.py
@@ -742,7 +742,7 @@ class StorageDriver(BaseDriver):
chunk = ''
if chunked:
response.connection.connection.send(b('%X\r\n' %
- (len(chunk))))
+ (len(chunk))))
response.connection.connection.send(chunk)
response.connection.connection.send(b('\r\n'))
response.connection.connection.send(b('0\r\n\r\n'))
@@ -754,7 +754,7 @@ class StorageDriver(BaseDriver):
try:
if chunked:
response.connection.connection.send(b('%X\r\n' %
- (len(chunk))))
+ (len(chunk))))
response.connection.connection.send(b(chunk))
response.connection.connection.send(b('\r\n'))
else:
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b6a68a/libcloud/test/compute/test_vcloud.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_vcloud.py b/libcloud/test/compute/test_vcloud.py
index b44162a..fc801be 100644
--- a/libcloud/test/compute/test_vcloud.py
+++ b/libcloud/test/compute/test_vcloud.py
@@ -478,9 +478,10 @@ class VCloud_1_5_MockHttp(MockHttp, unittest.TestCase):
fixtures = ComputeFileFixtures('vcloud_1_5')
def request(self, method, url, body=None, headers=None, raw=False):
- self.assertTrue(url.startswith('/api/'), ('"%s" is invalid. Needs to '
- 'start with "/api". The passed URL should be just '
- 'the path, not full URL.', url))
+ self.assertTrue(url.startswith('/api/'),
+ ('"%s" is invalid. Needs to '
+ 'start with "/api". The passed URL should be just '
+ 'the path, not full URL.', url))
super(VCloud_1_5_MockHttp, self).request(method, url, body, headers,
raw)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/95b6a68a/libcloud/test/loadbalancer/test_rackspace.py
----------------------------------------------------------------------
diff --git a/libcloud/test/loadbalancer/test_rackspace.py b/libcloud/test/loadbalancer/test_rackspace.py
index 1d183ec..5d6a0cf 100644
--- a/libcloud/test/loadbalancer/test_rackspace.py
+++ b/libcloud/test/loadbalancer/test_rackspace.py
@@ -158,7 +158,7 @@ class RackspaceLBTests(unittest.TestCase):
Member(
None, '10.1.0.10', 80,
extra={'condition': MemberCondition.DISABLED,
- 'weight': 10}),
+ 'weight': 10}),
Member(None, '10.1.0.11', 80))
)
[4/4] git commit: flake8's --exclude flag doesn't like /
Posted by to...@apache.org.
flake8's --exclude flag doesn't like /
Signed-off-by: Tomaz Muraus <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/ecd63e84
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/ecd63e84
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/ecd63e84
Branch: refs/heads/trunk
Commit: ecd63e84b2eb87b5b6f5fdbd197126f18df77822
Parents: 121daef
Author: Franck Cuny <fr...@gmail.com>
Authored: Sun Mar 30 11:13:21 2014 -0700
Committer: Tomaz Muraus <to...@apache.org>
Committed: Sun Mar 30 22:55:41 2014 +0200
----------------------------------------------------------------------
tox.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/ecd63e84/tox.ini
----------------------------------------------------------------------
diff --git a/tox.ini b/tox.ini
index 157031a..4f581e2 100644
--- a/tox.ini
+++ b/tox.ini
@@ -47,7 +47,7 @@ commands = python ../contrib/generate_provider_feature_matrix_table.py
[testenv:lint]
deps = flake8
-commands = flake8 --exclude="test/" libcloud/
+commands = flake8 --exclude="test" libcloud/
flake8 --max-line-length=160 libcloud/test/
flake8 demos/
flake8 --ignore=E902 docs/examples/
[3/4] git commit: Fix PEP8's E713 and E714.
Posted by to...@apache.org.
Fix PEP8's E713 and E714.
Two new tests were introduced with pep8 1.5 to report when operators
'not in' and 'is not' are recommended.
Signed-off-by: Tomaz Muraus <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/51af25e7
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/51af25e7
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/51af25e7
Branch: refs/heads/trunk
Commit: 51af25e74d239d30198450f44314f448ca6a6b53
Parents: e66146f
Author: Franck Cuny <fr...@gmail.com>
Authored: Sun Mar 30 11:20:04 2014 -0700
Committer: Tomaz Muraus <to...@apache.org>
Committed: Sun Mar 30 22:55:41 2014 +0200
----------------------------------------------------------------------
libcloud/compute/base.py | 2 +-
libcloud/compute/drivers/abiquo.py | 8 ++++----
libcloud/compute/drivers/cloudsigma.py | 4 ++--
libcloud/compute/drivers/ibm_sce.py | 2 +-
libcloud/compute/drivers/linode.py | 2 +-
libcloud/compute/drivers/rimuhosting.py | 10 +++++-----
libcloud/dns/drivers/rackspace.py | 2 +-
libcloud/pricing.py | 2 +-
libcloud/storage/drivers/google_storage.py | 4 ++--
libcloud/storage/drivers/s3.py | 4 ++--
10 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/51af25e7/libcloud/compute/base.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/base.py b/libcloud/compute/base.py
index e901f34..df6d296 100644
--- a/libcloud/compute/base.py
+++ b/libcloud/compute/base.py
@@ -865,7 +865,7 @@ class NodeDriver(BaseDriver):
pass
elif 'create_node' in self.features:
f = self.features['create_node']
- if not 'generates_password' in f and not "password" in f:
+ if 'generates_password' not in f and "password" not in f:
raise NotImplementedError(
'deploy_node not implemented for this driver')
else:
http://git-wip-us.apache.org/repos/asf/libcloud/blob/51af25e7/libcloud/compute/drivers/abiquo.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/abiquo.py b/libcloud/compute/drivers/abiquo.py
index 398087b..ab74778 100644
--- a/libcloud/compute/drivers/abiquo.py
+++ b/libcloud/compute/drivers/abiquo.py
@@ -290,7 +290,7 @@ class AbiquoNodeDriver(NodeDriver):
if location is None:
location = self.list_locations()[0]
- elif not location in self.list_locations():
+ elif location not in self.list_locations():
raise LibcloudError('Location does not exist')
link_vdc = self.connection.cache['locations'][location]
@@ -630,7 +630,7 @@ class AbiquoNodeDriver(NodeDriver):
location will be created.
"""
# First, get image location
- if not 'image' in kwargs:
+ if 'image' not in kwargs:
error = "'image' parameter is mandatory"
raise LibcloudError(error, self)
@@ -640,7 +640,7 @@ class AbiquoNodeDriver(NodeDriver):
location = None
if 'location' in kwargs:
location = kwargs['location']
- if not location in self.list_locations():
+ if location not in self.list_locations():
raise LibcloudError('Location does not exist')
# Check if the image is compatible with any of the locations or
@@ -669,7 +669,7 @@ class AbiquoNodeDriver(NodeDriver):
If we can not find any group, create it into argument 'location'
"""
- if not 'group_name' in kwargs:
+ if 'group_name' not in kwargs:
group_name = NodeGroup.DEFAULT_GROUP_NAME
else:
group_name = kwargs['group_name']
http://git-wip-us.apache.org/repos/asf/libcloud/blob/51af25e7/libcloud/compute/drivers/cloudsigma.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudsigma.py b/libcloud/compute/drivers/cloudsigma.py
index 833dea2..ccad8b1 100644
--- a/libcloud/compute/drivers/cloudsigma.py
+++ b/libcloud/compute/drivers/cloudsigma.py
@@ -918,7 +918,7 @@ class CloudSigma_2_0_Response(JsonResponse):
return None
for item in body:
- if not 'error_type' in item:
+ if 'error_type' not in item:
# Unrecognized error
continue
@@ -991,7 +991,7 @@ class CloudSigma_2_0_NodeDriver(CloudSigmaNodeDriver):
def __init__(self, key, secret, secure=True, host=None, port=None,
region=DEFAULT_REGION, **kwargs):
- if not region in API_ENDPOINTS_2_0:
+ if region not in API_ENDPOINTS_2_0:
raise ValueError('Invalid region: %s' % (region))
if not secure:
http://git-wip-us.apache.org/repos/asf/libcloud/blob/51af25e7/libcloud/compute/drivers/ibm_sce.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ibm_sce.py b/libcloud/compute/drivers/ibm_sce.py
index 830fa6a..bcf73b9 100644
--- a/libcloud/compute/drivers/ibm_sce.py
+++ b/libcloud/compute/drivers/ibm_sce.py
@@ -64,7 +64,7 @@ class IBMConnection(ConnectionUserAndKey):
headers['Accept'] = 'text/xml'
headers['Authorization'] = ('Basic %s' % (base64.b64encode(
b('%s:%s' % (self.user_id, self.key))).decode('utf-8')))
- if not 'Content-Type' in headers:
+ if 'Content-Type' not in headers:
headers['Content-Type'] = 'text/xml'
return headers
http://git-wip-us.apache.org/repos/asf/libcloud/blob/51af25e7/libcloud/compute/drivers/linode.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/linode.py b/libcloud/compute/drivers/linode.py
index c25e363..428ce3c 100644
--- a/libcloud/compute/drivers/linode.py
+++ b/libcloud/compute/drivers/linode.py
@@ -244,7 +244,7 @@ class LinodeNodeDriver(NodeDriver):
if not ssh and not root:
raise LinodeException(0xFB, "Need SSH key or root password")
- if not root is None and len(root) < 6:
+ if root is not None and len(root) < 6:
raise LinodeException(0xFB, "Root password is too short")
# Swap size
http://git-wip-us.apache.org/repos/asf/libcloud/blob/51af25e7/libcloud/compute/drivers/rimuhosting.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/rimuhosting.py b/libcloud/compute/drivers/rimuhosting.py
index 35bd9e4..ebe6bc9 100644
--- a/libcloud/compute/drivers/rimuhosting.py
+++ b/libcloud/compute/drivers/rimuhosting.py
@@ -299,29 +299,29 @@ class RimuHostingNodeDriver(NodeDriver):
kwargs['ex_vps_order_oid_to_clone']
if 'ex_num_ips' in kwargs and int(kwargs['ex_num_ips']) > 1:
- if not 'ex_extra_ip_reason' in kwargs:
+ if 'ex_extra_ip_reason' not in kwargs:
raise RimuHostingException(
'Need an reason for having an extra IP')
else:
- if not 'ip_request' in data:
+ if 'ip_request' not in data:
data['ip_request'] = {}
data['ip_request']['num_ips'] = int(kwargs['ex_num_ips'])
data['ip_request']['extra_ip_reason'] = \
kwargs['ex_extra_ip_reason']
if 'ex_memory_mb' in kwargs:
- if not 'vps_parameters' in data:
+ if 'vps_parameters' not in data:
data['vps_parameters'] = {}
data['vps_parameters']['memory_mb'] = kwargs['ex_memory_mb']
if 'ex_disk_space_mb' in kwargs:
- if not 'ex_vps_parameters' in data:
+ if 'ex_vps_parameters' not in data:
data['vps_parameters'] = {}
data['vps_parameters']['disk_space_mb'] = \
kwargs['ex_disk_space_mb']
if 'ex_disk_space_2_mb' in kwargs:
- if not 'vps_parameters' in data:
+ if 'vps_parameters' not in data:
data['vps_parameters'] = {}
data['vps_parameters']['disk_space_2_mb'] =\
kwargs['ex_disk_space_2_mb']
http://git-wip-us.apache.org/repos/asf/libcloud/blob/51af25e7/libcloud/dns/drivers/rackspace.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/rackspace.py b/libcloud/dns/drivers/rackspace.py
index fc7da74..55f834f 100644
--- a/libcloud/dns/drivers/rackspace.py
+++ b/libcloud/dns/drivers/rackspace.py
@@ -210,7 +210,7 @@ class RackspaceDNSDriver(DNSDriver, OpenStackDriverMixin):
extra = extra if extra else {}
# Email address is required
- if not 'email' in extra:
+ if 'email' not in extra:
raise ValueError('"email" key must be present in extra dictionary')
payload = {'name': domain, 'emailAddress': extra['email'],
http://git-wip-us.apache.org/repos/asf/libcloud/blob/51af25e7/libcloud/pricing.py
----------------------------------------------------------------------
diff --git a/libcloud/pricing.py b/libcloud/pricing.py
index dd8de96..abf71e6 100644
--- a/libcloud/pricing.py
+++ b/libcloud/pricing.py
@@ -79,7 +79,7 @@ def get_pricing(driver_type, driver_name, pricing_file_path=None):
:return: Dictionary with pricing where a key name is size ID and
the value is a price.
"""
- if not driver_type in VALID_PRICING_DRIVER_TYPES:
+ if driver_type not in VALID_PRICING_DRIVER_TYPES:
raise AttributeError('Invalid driver type: %s', driver_type)
if driver_name in PRICING_DATA[driver_type]:
http://git-wip-us.apache.org/repos/asf/libcloud/blob/51af25e7/libcloud/storage/drivers/google_storage.py
----------------------------------------------------------------------
diff --git a/libcloud/storage/drivers/google_storage.py b/libcloud/storage/drivers/google_storage.py
index 6dd6054..9caca9b 100644
--- a/libcloud/storage/drivers/google_storage.py
+++ b/libcloud/storage/drivers/google_storage.py
@@ -90,10 +90,10 @@ class GoogleStorageConnection(ConnectionUserAndKey):
elif key.lower().startswith('x-goog-'):
extension_header_values[key.lower()] = value.strip()
- if not 'content-md5' in special_header_values:
+ if 'content-md5' not in special_header_values:
special_header_values['content-md5'] = ''
- if not 'content-type' in special_header_values:
+ if 'content-type' not in special_header_values:
special_header_values['content-type'] = ''
keys_sorted = list(special_header_values.keys())
http://git-wip-us.apache.org/repos/asf/libcloud/blob/51af25e7/libcloud/storage/drivers/s3.py
----------------------------------------------------------------------
diff --git a/libcloud/storage/drivers/s3.py b/libcloud/storage/drivers/s3.py
index 8164939..9577f98 100644
--- a/libcloud/storage/drivers/s3.py
+++ b/libcloud/storage/drivers/s3.py
@@ -137,10 +137,10 @@ class BaseS3Connection(ConnectionUserAndKey):
elif key_lower.startswith('x-amz-'):
amz_header_values[key.lower()] = value.strip()
- if not 'content-md5' in special_header_values:
+ if 'content-md5' not in special_header_values:
special_header_values['content-md5'] = ''
- if not 'content-type' in special_header_values:
+ if 'content-type' not in special_header_values:
special_header_values['content-type'] = ''
if expires:
[2/4] git commit: Fix for PEP8's E265.
Posted by to...@apache.org.
Fix for PEP8's E265.
pep8 1.5 introduced a new test (E265) to ensure there's at least one
space before block comment.
Signed-off-by: Tomaz Muraus <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e66146fe
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e66146fe
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e66146fe
Branch: refs/heads/trunk
Commit: e66146fe11a05a3110dec13b6e956a6c3562aa70
Parents: ecd63e8
Author: Franck Cuny <fr...@gmail.com>
Authored: Sun Mar 30 11:17:34 2014 -0700
Committer: Tomaz Muraus <to...@apache.org>
Committed: Sun Mar 30 22:55:41 2014 +0200
----------------------------------------------------------------------
docs/examples/compute/openstack/hpcloud.py | 4 +-
libcloud/common/base.py | 6 +--
libcloud/compute/drivers/abiquo.py | 2 +-
libcloud/compute/drivers/dreamhost.py | 2 +-
libcloud/compute/drivers/ecp.py | 68 ++++++++++++-------------
libcloud/compute/drivers/hostvirtual.py | 2 +-
libcloud/compute/drivers/nephoscale.py | 16 +++---
libcloud/compute/drivers/openstack.py | 2 +-
libcloud/compute/drivers/opsource.py | 5 +-
libcloud/compute/drivers/rimuhosting.py | 2 +-
libcloud/compute/drivers/softlayer.py | 2 +-
libcloud/loadbalancer/drivers/rackspace.py | 2 +-
libcloud/storage/drivers/s3.py | 4 +-
libcloud/test/compute/test_gridspot.py | 2 +-
libcloud/test/compute/test_openstack.py | 10 ++--
libcloud/test/dns/test_route53.py | 2 +-
libcloud/test/test_connection.py | 4 +-
17 files changed, 68 insertions(+), 67 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/docs/examples/compute/openstack/hpcloud.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/openstack/hpcloud.py b/docs/examples/compute/openstack/hpcloud.py
index 0b226b5..cbfda3d 100644
--- a/docs/examples/compute/openstack/hpcloud.py
+++ b/docs/examples/compute/openstack/hpcloud.py
@@ -8,7 +8,7 @@ HPCLOUD_AUTH_URL_USEAST = \
OpenStack = get_driver(Provider.OPENSTACK)
-#HP Cloud US West
+# HP Cloud US West
driver = OpenStack('your_auth_username', 'your_auth_password',
ex_force_auth_version='2.0_password',
ex_force_auth_url=HPCLOUD_AUTH_URL_USWEST,
@@ -16,7 +16,7 @@ driver = OpenStack('your_auth_username', 'your_auth_password',
ex_force_service_region='region-a.geo-1',
ex_force_service_name='Compute')
-#HP Cloud US East
+# HP Cloud US East
driver = OpenStack('your_auth_username', 'your_auth_password',
ex_force_auth_version='2.0_password',
ex_force_auth_url=HPCLOUD_AUTH_URL_USEAST,
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/common/base.py
----------------------------------------------------------------------
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index 178c218..8537c07 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -259,7 +259,7 @@ class RawResponse(Response):
return self._reason
-#TODO: Move this to a better location/package
+# TODO: Move this to a better location/package
class LoggingConnection():
"""
Debug class to log all HTTP(s) requests as they could be made
@@ -402,7 +402,7 @@ class Connection(object):
"""
A Base Connection class to derive from.
"""
- #conn_classes = (LoggingHTTPSConnection)
+ # conn_classes = (LoggingHTTPSConnection)
conn_classes = (LibcloudHTTPConnection, LibcloudHTTPSConnection)
responseCls = Response
@@ -523,7 +523,7 @@ class Connection(object):
# which proxies to your endpoint, and lets you easily capture
# connections in cleartext when you setup the proxy to do SSL
# for you
- #connection = self.conn_classes[False]("127.0.0.1", 8080)
+ # connection = self.conn_classes[False]("127.0.0.1", 8080)
self.connection = connection
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/compute/drivers/abiquo.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/abiquo.py b/libcloud/compute/drivers/abiquo.py
index b3e2d2e..398087b 100644
--- a/libcloud/compute/drivers/abiquo.py
+++ b/libcloud/compute/drivers/abiquo.py
@@ -573,7 +573,7 @@ class AbiquoNodeDriver(NodeDriver):
repo_link = get_href(image_element, 'datacenterrepository')
image = self._to_nodeimage(image_element, self, repo_link)
- ## Fill the 'ips' data
+ # Fill the 'ips' data
private_ips = []
public_ips = []
nics_element = self.connection.request(get_href(vm, 'nics')).object
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/compute/drivers/dreamhost.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dreamhost.py b/libcloud/compute/drivers/dreamhost.py
index d0a2396..cba445c 100644
--- a/libcloud/compute/drivers/dreamhost.py
+++ b/libcloud/compute/drivers/dreamhost.py
@@ -116,7 +116,7 @@ class DreamhostConnection(ConnectionKey):
"""
params['key'] = self.key
params['format'] = self.format
- #params['unique_id'] = generate_unique_id()
+ # params['unique_id'] = generate_unique_id()
return params
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/compute/drivers/ecp.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ecp.py b/libcloud/compute/drivers/ecp.py
index 021e7b0..79b57fa 100644
--- a/libcloud/compute/drivers/ecp.py
+++ b/libcloud/compute/drivers/ecp.py
@@ -38,7 +38,7 @@ from libcloud.compute.base import NodeImage, Node
from libcloud.compute.types import Provider, NodeState, InvalidCredsError
from libcloud.utils.networking import is_private_subnet
-#Defaults
+# Defaults
API_HOST = ''
API_PORT = (80, 443)
@@ -65,7 +65,7 @@ class ECPResponse(Response):
def parse_error(self):
return self.error
- #Interpret the json responses - no error checking required
+ # Interpret the json responses - no error checking required
def parse_body(self):
return json.loads(self.body)
@@ -83,7 +83,7 @@ class ECPConnection(ConnectionUserAndKey):
port = API_PORT
def add_default_headers(self, headers):
- #Authentication
+ # Authentication
username = self.user_id
password = self.key
base64string = base64.encodestring(
@@ -98,7 +98,7 @@ class ECPConnection(ConnectionUserAndKey):
Based on Wade Leftwich's function:
http://code.activestate.com/recipes/146306/
"""
- #use a random boundary that does not appear in the fields
+ # use a random boundary that does not appear in the fields
boundary = ''
while boundary in ''.join(fields):
boundary = binascii.hexlify(os.urandom(16)).decode('utf-8')
@@ -133,17 +133,17 @@ class ECPNodeDriver(NodeDriver):
:rtype: ``list`` of :class:`Node`
"""
- #Make the call
+ # Make the call
res = self.connection.request('/rest/hosting/vm/list').parse_body()
- #Put together a list of node objects
+ # Put together a list of node objects
nodes = []
for vm in res['vms']:
node = self._to_node(vm)
- if not node is None:
+ if node is not None:
nodes.append(node)
- #And return it
+ # And return it
return nodes
def _to_node(self, vm):
@@ -152,11 +152,11 @@ class ECPNodeDriver(NodeDriver):
This returns only running VMs.
"""
- #Check state
+ # Check state
if not vm['state'] == "running":
return None
- #IPs
+ # IPs
iplist = [interface['ip'] for interface in vm['interfaces'] if
interface['ip'] != '127.0.0.1']
@@ -173,7 +173,7 @@ class ECPNodeDriver(NodeDriver):
else:
public_ips.append(ip)
- #Create the node object
+ # Create the node object
n = Node(
id=vm['uuid'],
name=vm['name'],
@@ -192,8 +192,8 @@ class ECPNodeDriver(NodeDriver):
@inherits: :class:`NodeDriver.reboot_node`
"""
- #Turn the VM off
- #Black magic to make the POST requests work
+ # Turn the VM off
+ # Black magic to make the POST requests work
d = self.connection._encode_multipart_formdata({'action': 'stop'})
self.connection.request(
'/rest/hosting/vm/%s' % node.id,
@@ -203,9 +203,9 @@ class ECPNodeDriver(NodeDriver):
).parse_body()
node.state = NodeState.REBOOTING
- #Wait for it to turn off and then continue (to turn it on again)
+ # Wait for it to turn off and then continue (to turn it on again)
while node.state == NodeState.REBOOTING:
- #Check if it's off.
+ # Check if it's off.
response = self.connection.request(
'/rest/hosting/vm/%s' % node.id
).parse_body()
@@ -214,8 +214,8 @@ class ECPNodeDriver(NodeDriver):
else:
time.sleep(5)
- #Turn the VM back on.
- #Black magic to make the POST requests work
+ # Turn the VM back on.
+ # Black magic to make the POST requests work
d = self.connection._encode_multipart_formdata({'action': 'start'})
self.connection.request(
'/rest/hosting/vm/%s' % node.id,
@@ -234,8 +234,8 @@ class ECPNodeDriver(NodeDriver):
@inherits: :class:`NodeDriver.destroy_node`
"""
- #Shut down first
- #Black magic to make the POST requests work
+ # Shut down first
+ # Black magic to make the POST requests work
d = self.connection._encode_multipart_formdata({'action': 'stop'})
self.connection.request(
'/rest/hosting/vm/%s' % node.id,
@@ -244,11 +244,11 @@ class ECPNodeDriver(NodeDriver):
data=d[1]
).parse_body()
- #Ensure there was no applicationl level error
+ # Ensure there was no applicationl level error
node.state = NodeState.PENDING
- #Wait for the VM to turn off before continuing
+ # Wait for the VM to turn off before continuing
while node.state == NodeState.PENDING:
- #Check if it's off.
+ # Check if it's off.
response = self.connection.request(
'/rest/hosting/vm/%s' % node.id
).parse_body()
@@ -257,8 +257,8 @@ class ECPNodeDriver(NodeDriver):
else:
time.sleep(5)
- #Delete the VM
- #Black magic to make the POST requests work
+ # Delete the VM
+ # Black magic to make the POST requests work
d = self.connection._encode_multipart_formdata({'action': 'delete'})
self.connection.request(
'/rest/hosting/vm/%s' % (node.id),
@@ -276,11 +276,11 @@ class ECPNodeDriver(NodeDriver):
@inherits: :class:`NodeDriver.list_images`
"""
- #Make the call
+ # Make the call
response = self.connection.request(
'/rest/hosting/ptemplate/list').parse_body()
- #Turn the response into an array of NodeImage objects
+ # Turn the response into an array of NodeImage objects
images = []
for ptemplate in response['packages']:
images.append(NodeImage(
@@ -298,11 +298,11 @@ class ECPNodeDriver(NodeDriver):
@inherits: :class:`NodeDriver.list_sizes`
"""
- #Make the call
+ # Make the call
response = self.connection.request(
'/rest/hosting/htemplate/list').parse_body()
- #Turn the response into an array of NodeSize objects
+ # Turn the response into an array of NodeSize objects
sizes = []
for htemplate in response['templates']:
sizes.append(NodeSize(
@@ -346,15 +346,15 @@ class ECPNodeDriver(NodeDriver):
:rtype: :class:`Node`
"""
- #Find out what network to put the VM on.
+ # Find out what network to put the VM on.
res = self.connection.request(
'/rest/hosting/network/list').parse_body()
- #Use the first / default network because there is no way to specific
- #which one
+ # Use the first / default network because there is no way to specific
+ # which one
network = res['networks'][0]['uuid']
- #Prepare to make the VM
+ # Prepare to make the VM
data = {
'name': str(kwargs['name']),
'package': str(kwargs['image'].id),
@@ -363,7 +363,7 @@ class ECPNodeDriver(NodeDriver):
'disk': ''
}
- #Black magic to make the POST requests work
+ # Black magic to make the POST requests work
d = self.connection._encode_multipart_formdata(data)
response = self.connection.request(
'/rest/hosting/vm/',
@@ -372,7 +372,7 @@ class ECPNodeDriver(NodeDriver):
data=d[1]
).parse_body()
- #Create a node object and return it.
+ # Create a node object and return it.
n = Node(
id=response['machine_id'],
name=data['name'],
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/compute/drivers/hostvirtual.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/hostvirtual.py b/libcloud/compute/drivers/hostvirtual.py
index ebef915..e9fa6c8 100644
--- a/libcloud/compute/drivers/hostvirtual.py
+++ b/libcloud/compute/drivers/hostvirtual.py
@@ -211,7 +211,7 @@ class HostVirtualNodeDriver(NodeDriver):
def destroy_node(self, node):
params = {
'mbpkgid': node.id,
- #'reason': 'Submitted through Libcloud API'
+ # 'reason': 'Submitted through Libcloud API'
}
result = self.connection.request(
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/compute/drivers/nephoscale.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/nephoscale.py b/libcloud/compute/drivers/nephoscale.py
index efe5089..1888ac8 100644
--- a/libcloud/compute/drivers/nephoscale.py
+++ b/libcloud/compute/drivers/nephoscale.py
@@ -48,10 +48,10 @@ NODE_STATE_MAP = {
VALID_RESPONSE_CODES = [httplib.OK, httplib.ACCEPTED, httplib.CREATED,
httplib.NO_CONTENT]
-#used in create_node and specifies how many times to get the list of nodes and
-#check if the newly created node is there. This is because when a request is
-#sent to create a node, NephoScale replies with the job id, and not the node
-#itself thus we don't have the ip addresses, that are required in deploy_node
+# used in create_node and specifies how many times to get the list of nodes and
+# check if the newly created node is there. This is because when a request is
+# sent to create a node, NephoScale replies with the job id, and not the node
+# itself thus we don't have the ip addresses, that are required in deploy_node
CONNECT_ATTEMPTS = 10
@@ -388,9 +388,9 @@ get all keys call with no arguments')
if not nowait:
return node
else:
- #try to get the created node public ips, for use in deploy_node
- #At this point we don't have the id of the newly created Node,
- #so search name in nodes
+ # try to get the created node public ips, for use in deploy_node
+ # At this point we don't have the id of the newly created Node,
+ # so search name in nodes
created_node = False
while connect_attempts > 0:
nodes = self.list_nodes()
@@ -411,7 +411,7 @@ get all keys call with no arguments')
public_ips = []
private_ips = []
ip_addresses = data.get('ipaddresses', '')
- #E.g. "ipaddresses": "198.120.14.6, 10.132.60.1"
+ # E.g. "ipaddresses": "198.120.14.6, 10.132.60.1"
if ip_addresses:
for ip in ip_addresses.split(','):
ip = ip.replace(' ', '')
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/compute/drivers/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py
index c7d0b09..83a5dad 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -1989,7 +1989,7 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
public_ips.extend(ips)
else:
for ip in ips:
- #is_private_subnet does not check for ipv6
+ # is_private_subnet does not check for ipv6
try:
if is_private_subnet(ip):
private_ips.append(ip)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/compute/drivers/opsource.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/opsource.py b/libcloud/compute/drivers/opsource.py
index c38b042..a2024c3 100644
--- a/libcloud/compute/drivers/opsource.py
+++ b/libcloud/compute/drivers/opsource.py
@@ -46,7 +46,7 @@ from libcloud.compute.types import NodeState, Provider
# x implement list_images() (only support Base OS images,
# no customer images yet)
# x implement list_locations()
-# x implement ex_* extension functions for opsource-specific featurebody =s
+# x implement ex_* extension functions for opsource-specific featurebody
# x ex_graceful_shutdown
# x ex_start_node
# x ex_power_off
@@ -67,7 +67,8 @@ from libcloud.compute.types import NodeState, Provider
# - delete customer images
# - modify customer images
# - add "pending-servers" in list_nodes()
-# - implement various ex_* extension functions for opsource-specific features
+# - implement various ex_* extension functions for opsource-specific
+# features
# - ex_modify_server()
# - ex_add_storage_to_server()
# - ex_snapshot_server() (create's customer image)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/compute/drivers/rimuhosting.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/rimuhosting.py b/libcloud/compute/drivers/rimuhosting.py
index 32fbb74..35bd9e4 100644
--- a/libcloud/compute/drivers/rimuhosting.py
+++ b/libcloud/compute/drivers/rimuhosting.py
@@ -288,7 +288,7 @@ class RimuHostingNodeDriver(NodeDriver):
data['instantiation_options']['password'] = auth.password
if 'ex_billing_oid' in kwargs:
- #TODO check for valid oid.
+ # TODO check for valid oid.
data['billing_oid'] = kwargs['ex_billing_oid']
if 'ex_host_server_oid' in kwargs:
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/compute/drivers/softlayer.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/softlayer.py b/libcloud/compute/drivers/softlayer.py
index 3f89938..ced4a34 100644
--- a/libcloud/compute/drivers/softlayer.py
+++ b/libcloud/compute/drivers/softlayer.py
@@ -341,7 +341,7 @@ class SoftLayerNodeDriver(NodeDriver):
price=None,
driver=self.connection.driver))
ex_size_data = SL_TEMPLATES.get(int(size.id)) or {}
- #plan keys are ints
+ # plan keys are ints
cpu_count = kwargs.get('ex_cpus') or ex_size_data.get('cpus') or \
DEFAULT_CPU_SIZE
ram = kwargs.get('ex_ram') or ex_size_data.get('ram') or \
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/loadbalancer/drivers/rackspace.py
----------------------------------------------------------------------
diff --git a/libcloud/loadbalancer/drivers/rackspace.py b/libcloud/loadbalancer/drivers/rackspace.py
index 13be22c..1807ed6 100644
--- a/libcloud/loadbalancer/drivers/rackspace.py
+++ b/libcloud/loadbalancer/drivers/rackspace.py
@@ -404,7 +404,7 @@ class RackspaceLBDriver(Driver, OpenStackDriverMixin):
balancer_attrs.update({
'nodes': [self._member_attributes(member) for member in members],
})
- #balancer_attrs['nodes'] = ['fu']
+ # balancer_attrs['nodes'] = ['fu']
balancer_object = {"loadBalancer": balancer_attrs}
resp = self.connection.request('/loadbalancers',
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/storage/drivers/s3.py
----------------------------------------------------------------------
diff --git a/libcloud/storage/drivers/s3.py b/libcloud/storage/drivers/s3.py
index 69dcafc..8164939 100644
--- a/libcloud/storage/drivers/s3.py
+++ b/libcloud/storage/drivers/s3.py
@@ -817,8 +817,8 @@ class BaseS3StorageDriver(StorageDriver):
# TODO: Let the underlying exceptions bubble up and capture the SIGPIPE
# here.
- #SIGPIPE is thrown if the provided container does not exist or the user
- # does not have correct permission
+ # SIGPIPE is thrown if the provided container does not exist or the
+ # user does not have correct permission
result_dict = self._upload_object(
object_name=object_name, content_type=content_type,
upload_func=upload_func, upload_func_kwargs=upload_func_kwargs,
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/test/compute/test_gridspot.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_gridspot.py b/libcloud/test/compute/test_gridspot.py
index 2fe80f7..0160f8e 100644
--- a/libcloud/test/compute/test_gridspot.py
+++ b/libcloud/test/compute/test_gridspot.py
@@ -48,7 +48,7 @@ class GridspotTest(unittest.TestCase, TestCaseMixin):
GridspotMockHttp.type = 'BAD_AUTH'
try:
self.driver.list_nodes()
- # Above command should have thrown an InvalidCredsException
+ # Above command should have thrown an InvalidCredsException
self.assertTrue(False)
except InvalidCredsError:
self.assertTrue(True)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/test/compute/test_openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_openstack.py b/libcloud/test/compute/test_openstack.py
index bdc6979..ca379b2 100644
--- a/libcloud/test/compute/test_openstack.py
+++ b/libcloud/test/compute/test_openstack.py
@@ -301,7 +301,7 @@ class OpenStack_1_0_Tests(unittest.TestCase, TestCaseMixin):
driver_klass = OpenStack_1_0_NodeDriver
driver_args = OPENSTACK_PARAMS
driver_kwargs = {}
- #driver_kwargs = {'ex_force_auth_version': '1.0'}
+ # driver_kwargs = {'ex_force_auth_version': '1.0'}
@classmethod
def create_driver(self):
@@ -961,15 +961,15 @@ class OpenStack_1_1_Tests(unittest.TestCase, TestCaseMixin):
node = nodes[0]
self.assertEqual('12065', node.id)
- #test public IPv4
+ # test public IPv4
self.assertTrue('12.16.18.28' in node.public_ips)
self.assertTrue('50.57.94.35' in node.public_ips)
- #test public IPv6
+ # test public IPv6
self.assertTrue(
'2001:4801:7808:52:16:3eff:fe47:788a' in node.public_ips)
- #test private IPv4
+ # test private IPv4
self.assertTrue('10.182.64.34' in node.private_ips)
- #test private IPv6
+ # test private IPv6
self.assertTrue(
'fec0:4801:7808:52:16:3eff:fe60:187d' in node.private_ips)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/test/dns/test_route53.py
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/test_route53.py b/libcloud/test/dns/test_route53.py
index bc11125..2994203 100644
--- a/libcloud/test/dns/test_route53.py
+++ b/libcloud/test/dns/test_route53.py
@@ -220,7 +220,7 @@ class Route53MockHttp(MockHttp):
return (httplib.OK, body, {}, httplib.responses[httplib.OK])
def _2012_02_29_hostedzone(self, method, url, body, headers):
- #print method, url, body, headers
+ # print method, url, body, headers
if method == "POST":
body = self.fixtures.load("create_zone.xml")
return (httplib.CREATED, body, {}, httplib.responses[httplib.OK])
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e66146fe/libcloud/test/test_connection.py
----------------------------------------------------------------------
diff --git a/libcloud/test/test_connection.py b/libcloud/test/test_connection.py
index c17ff4d..ae09c7a 100644
--- a/libcloud/test/test_connection.py
+++ b/libcloud/test/test_connection.py
@@ -52,7 +52,7 @@ class ConnectionClassTestCase(unittest.TestCase):
con = Connection()
con.connection = Mock()
- ## GET method
+ # GET method
# No data, no content length should be present
con.request('/test', method='GET', data=None)
call_kwargs = con.connection.request.call_args[1]
@@ -69,7 +69,7 @@ class ConnectionClassTestCase(unittest.TestCase):
call_kwargs = con.connection.request.call_args[1]
self.assertEqual(call_kwargs['headers']['Content-Length'], '1')
- ## POST, PUT method
+ # POST, PUT method
# No data, content length should be present
for method in ['POST', 'PUT', 'post', 'put']:
con.request('/test', method=method, data=None)