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 <[email protected]> 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 <[email protected]> Authored: Sun Mar 30 11:22:15 2014 -0700 Committer: Tomaz Muraus <[email protected]> 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)) )
