libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject git commit: Fix for various PEP8 errors.
Date Mon, 07 Apr 2014 14:42:08 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 95b6a68ad -> e780066b2


Fix for various PEP8 errors.

pep8 1.5.2 started to report errors when a new line follows the
parameter equal, and when a variable is redefined in a list
comprehension.

Signed-off-by: Tomaz Muraus <tomaz@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e780066b
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e780066b
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e780066b

Branch: refs/heads/trunk
Commit: e780066b2f8942732a4df66142455a020f44d787
Parents: 95b6a68
Author: Franck Cuny <franck.cuny@gmail.com>
Authored: Fri Apr 4 21:31:59 2014 -0700
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Mon Apr 7 08:40:12 2014 -0600

----------------------------------------------------------------------
 .../cloudstack/security_groups_management.py     | 10 +++++-----
 libcloud/common/cloudstack.py                    | 11 +++--------
 libcloud/common/openstack.py                     |  4 ++--
 libcloud/compute/drivers/cloudstack.py           | 19 +++++--------------
 libcloud/compute/drivers/openstack.py            | 15 +++++----------
 libcloud/test/compute/test_cloudsigma_v2_0.py    |  4 ++--
 libcloud/utils/misc.py                           |  2 +-
 7 files changed, 23 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e780066b/docs/examples/compute/cloudstack/security_groups_management.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/cloudstack/security_groups_management.py b/docs/examples/compute/cloudstack/security_groups_management.py
index 5e12a13..be89b33 100644
--- a/docs/examples/compute/cloudstack/security_groups_management.py
+++ b/docs/examples/compute/cloudstack/security_groups_management.py
@@ -17,11 +17,11 @@ pprint(security_group)
 # Authorize an ingress rule on a security group
 # If `startport` is used alone, this will be the only port open
 # If `endport` is also used then the entire range will be authorized
-sg = driver.ex_authorize_security_group_ingress(securitygroupname=
-                                                'test-security-group',
-                                                protocol='tcp',
-                                                startport='22',
-                                                cidrlist='0.0.0.0/0')
+sg = driver.ex_authorize_security_group_ingress(
+    securitygroupname='test-security-group', protocol='tcp', startport='22',
+    cidrlist='0.0.0.0/0'
+)
+
 pprint(sg)
 
 # Delete a security group we have previously created

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e780066b/libcloud/common/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/common/cloudstack.py b/libcloud/common/cloudstack.py
index 99699d0..efd31c8 100644
--- a/libcloud/common/cloudstack.py
+++ b/libcloud/common/cloudstack.py
@@ -107,14 +107,9 @@ class CloudStackConnection(ConnectionUserAndKey, PollingConnection):
 
         # Command is specified as part of GET call
         context['command'] = command
-        result = super(CloudStackConnection, self).async_request(action=action,
-                                                                 params=params,
-                                                                 data=data,
-                                                                 headers=
-                                                                 headers,
-                                                                 method=method,
-                                                                 context=
-                                                                 context)
+        result = super(CloudStackConnection, self).async_request(
+            action=action, params=params, data=data, headers=headers,
+            method=method, context=context)
         return result['jobresult']
 
     def get_request_kwargs(self, action, params=None, data='', headers=None,

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e780066b/libcloud/common/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/common/openstack.py b/libcloud/common/openstack.py
index 5c4f02b..158a9f5 100644
--- a/libcloud/common/openstack.py
+++ b/libcloud/common/openstack.py
@@ -604,8 +604,8 @@ class OpenStackBaseConnection(ConnectionUserAndKey):
             self.auth_user_info = osa.auth_user_info
 
             # Pull out and parse the service catalog
-            osc = OpenStackServiceCatalog(osa.urls, ex_force_auth_version=
-                                          self._auth_version)
+            osc = OpenStackServiceCatalog(
+                osa.urls, ex_force_auth_version=self._auth_version)
             self.service_catalog = osc
 
         url = self._ex_force_base_url or self.get_endpoint()

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e780066b/libcloud/compute/drivers/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py
index c68c884..cd0cc3e 100644
--- a/libcloud/compute/drivers/cloudstack.py
+++ b/libcloud/compute/drivers/cloudstack.py
@@ -289,20 +289,11 @@ class CloudStackNode(Node):
         """
         Add a port forwarding rule for port or ports.
         """
-        return self.driver.ex_create_port_forwarding_rule(node=self,
-                                                          address=
-                                                          address,
-                                                          private_port=
-                                                          private_port,
-                                                          public_port=
-                                                          public_port,
-                                                          protocol=protocol,
-                                                          public_end_port=
-                                                          public_end_port,
-                                                          private_end_port=
-                                                          private_end_port,
-                                                          openfirewall=
-                                                          openfirewall)
+        return self.driver.ex_create_port_forwarding_rule(
+            node=self, address=address, private_port=private_port,
+            public_port=public_port, protocol=protocol,
+            public_end_port=public_end_port, private_end_port=private_end_port,
+            openfirewall=openfirewall)
 
     def ex_delete_ip_forwarding_rule(self, rule):
         """

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e780066b/libcloud/compute/drivers/openstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/openstack.py b/libcloud/compute/drivers/openstack.py
index 38223ee..3988030 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -1662,16 +1662,11 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
             group = obj['group'].get('name', None)
             tenant_id = obj['group'].get('tenant_id', None)
 
-        return OpenStackSecurityGroupRule(id=obj['id'],
-                                          parent_group_id=
-                                          obj['parent_group_id'],
-                                          ip_protocol=obj['ip_protocol'],
-                                          from_port=obj['from_port'],
-                                          to_port=obj['to_port'],
-                                          driver=self,
-                                          ip_range=ip_range,
-                                          group=group,
-                                          tenant_id=tenant_id)
+        return OpenStackSecurityGroupRule(
+            id=obj['id'], parent_group_id=obj['parent_group_id'],
+            ip_protocol=obj['ip_protocol'], from_port=obj['from_port'],
+            to_port=obj['to_port'], driver=self, ip_range=ip_range,
+            group=group, tenant_id=tenant_id)
 
     def _to_security_groups(self, obj):
         security_groups = obj['security_groups']

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e780066b/libcloud/test/compute/test_cloudsigma_v2_0.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_cloudsigma_v2_0.py b/libcloud/test/compute/test_cloudsigma_v2_0.py
index 6258a29..4bc66a5 100644
--- a/libcloud/test/compute/test_cloudsigma_v2_0.py
+++ b/libcloud/test/compute/test_cloudsigma_v2_0.py
@@ -388,8 +388,8 @@ class CloudSigmaAPI20BaseTestCase(object):
 
     def test_ex_toggle_subscription_auto_renew(self):
         subscription = self.driver.ex_list_subscriptions()[0]
-        status = self.driver.ex_toggle_subscription_auto_renew(subscription=
-                                                               subscription)
+        status = self.driver.ex_toggle_subscription_auto_renew(
+            subscription=subscription)
         self.assertTrue(status)
 
     def test_ex_list_capabilities(self):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e780066b/libcloud/utils/misc.py
----------------------------------------------------------------------
diff --git a/libcloud/utils/misc.py b/libcloud/utils/misc.py
index 21978e1..fbca4cb 100644
--- a/libcloud/utils/misc.py
+++ b/libcloud/utils/misc.py
@@ -166,7 +166,7 @@ def str2dicts(data):
         value = line[whitespace + 1:]
         d.update({key: value})
 
-    list_data = [value for value in list_data if value != {}]
+    list_data = [val for val in list_data if val != {}]
     return list_data
 
 


Mime
View raw message