libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [2/2] libcloud git commit: Fix lint violations and some actual issues detected by pylint in docs/examples/ Python file examples.
Date Sun, 24 Sep 2017 15:57:50 GMT
Fix lint violations and some actual issues detected by pylint in
docs/examples/ Python file examples.


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

Branch: refs/heads/trunk
Commit: c9d0a460dbaccd8c766ffcffa977d6c378705625
Parents: 0107413
Author: Tomaz Muraus <tomaz@tomaz.me>
Authored: Sun Sep 24 16:50:42 2017 +0200
Committer: Tomaz Muraus <tomaz@tomaz.me>
Committed: Sun Sep 24 16:50:42 2017 +0200

----------------------------------------------------------------------
 .../examples/compute/auroracompute/instantiate_driver_region.py | 4 ++--
 .../compute/cloudstack/start_interactive_shell_exoscale.py      | 1 +
 .../compute/cloudstack/start_interactive_shell_ikoula.py        | 1 +
 docs/examples/compute/ec2/create_general_purpose_ssd_volume.py  | 4 ++--
 docs/examples/compute/ec2/create_provisioned_iops_volume.py     | 4 ++--
 docs/examples/loadbalancer/elb/create_lb_connection_for_aws.py  | 4 ++--
 docs/examples/loadbalancer/elb/create_lb_policy.py              | 4 ++--
 docs/examples/loadbalancer/elb/create_load_balancer.py          | 4 ++--
 docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py  | 4 ++--
 docs/examples/loadbalancer/elb/ex_delete_balancer_policy.py     | 4 ++--
 docs/examples/loadbalancer/elb/ex_list_balancer_policies.py     | 4 ++--
 docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py | 4 ++--
 .../loadbalancer/elb/ex_set_balancer_policies_backend_server.py | 4 ++--
 .../loadbalancer/elb/ex_set_balancer_policies_listener.py       | 4 ++--
 docs/examples/loadbalancer/elb/list_load_balancer.py            | 4 ++--
 docs/examples/misc/twisted_create_node.py                       | 5 +++--
 docs/examples/storage/concurrent_file_download_using_gevent.py  | 4 ++--
 17 files changed, 33 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/compute/auroracompute/instantiate_driver_region.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/auroracompute/instantiate_driver_region.py b/docs/examples/compute/auroracompute/instantiate_driver_region.py
index 7d6bed8..d41b9eb 100644
--- a/docs/examples/compute/auroracompute/instantiate_driver_region.py
+++ b/docs/examples/compute/auroracompute/instantiate_driver_region.py
@@ -5,5 +5,5 @@ from libcloud.compute.drivers.auroracompute import AuroraComputeRegion
 apikey = 'mykey'
 secretkey = 'mysecret'
 
-Driver = get_driver(Provider.AURORACOMPUTE, region=AuroraComputeRegion.MIA)
-conn = Driver(key=apikey, secret=secretkey)
+Driver = get_driver(Provider.AURORACOMPUTE)
+conn = Driver(key=apikey, secret=secretkey, region=AuroraComputeRegion.MIA)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/compute/cloudstack/start_interactive_shell_exoscale.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/cloudstack/start_interactive_shell_exoscale.py b/docs/examples/compute/cloudstack/start_interactive_shell_exoscale.py
index 979a6b7..e0de028 100755
--- a/docs/examples/compute/cloudstack/start_interactive_shell_exoscale.py
+++ b/docs/examples/compute/cloudstack/start_interactive_shell_exoscale.py
@@ -1,5 +1,6 @@
 import os
 
+# pylint: disable=import-error
 from IPython.terminal.embed import InteractiveShellEmbed
 
 from libcloud.compute.types import Provider

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/compute/cloudstack/start_interactive_shell_ikoula.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/cloudstack/start_interactive_shell_ikoula.py b/docs/examples/compute/cloudstack/start_interactive_shell_ikoula.py
index 0b25765..2e79fe5 100755
--- a/docs/examples/compute/cloudstack/start_interactive_shell_ikoula.py
+++ b/docs/examples/compute/cloudstack/start_interactive_shell_ikoula.py
@@ -1,5 +1,6 @@
 import os
 
+# pylint: disable=import-error
 from IPython.terminal.embed import InteractiveShellEmbed
 
 from libcloud.compute.types import Provider

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/compute/ec2/create_general_purpose_ssd_volume.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/ec2/create_general_purpose_ssd_volume.py b/docs/examples/compute/ec2/create_general_purpose_ssd_volume.py
index d924103..5569d9c 100644
--- a/docs/examples/compute/ec2/create_general_purpose_ssd_volume.py
+++ b/docs/examples/compute/ec2/create_general_purpose_ssd_volume.py
@@ -1,8 +1,8 @@
 from libcloud.compute.types import Provider
 from libcloud.compute.providers import get_driver
 
-cls = get_driver(Provider.EC2, region='us-east-i1')
-driver = cls('access key', 'secret key')
+cls = get_driver(Provider.EC2)
+driver = cls('access key', 'secret key', region='us-east-i1')
 
 volume = driver.create_volume(size=100, name='Test GP volume',
                               ex_volume_type='gp2')

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/compute/ec2/create_provisioned_iops_volume.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/ec2/create_provisioned_iops_volume.py b/docs/examples/compute/ec2/create_provisioned_iops_volume.py
index 6414790..add7b8f 100644
--- a/docs/examples/compute/ec2/create_provisioned_iops_volume.py
+++ b/docs/examples/compute/ec2/create_provisioned_iops_volume.py
@@ -1,8 +1,8 @@
 from libcloud.compute.types import Provider
 from libcloud.compute.providers import get_driver
 
-cls = get_driver(Provider.EC2, region='us-east-i1')
-driver = cls('access key', 'secret key')
+cls = get_driver(Provider.EC2)
+driver = cls('access key', 'secret key', region='us-east-i1')
 
 volume = driver.create_volume(size=100, name='Test IOPS volume',
                               ex_volume_type='io1', ex_iops=1000)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/loadbalancer/elb/create_lb_connection_for_aws.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/elb/create_lb_connection_for_aws.py b/docs/examples/loadbalancer/elb/create_lb_connection_for_aws.py
index 62a767d..a48ec8c 100644
--- a/docs/examples/loadbalancer/elb/create_lb_connection_for_aws.py
+++ b/docs/examples/loadbalancer/elb/create_lb_connection_for_aws.py
@@ -1,5 +1,5 @@
-from libcloud.compute.types import Provider
-from libcloud.compute.providers import get_driver
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.providers import get_driver
 
 ACCESS_ID = 'your access id'
 SECRET_KEY = 'your secret key'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/loadbalancer/elb/create_lb_policy.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/elb/create_lb_policy.py b/docs/examples/loadbalancer/elb/create_lb_policy.py
index faa6645..b2869bd 100644
--- a/docs/examples/loadbalancer/elb/create_lb_policy.py
+++ b/docs/examples/loadbalancer/elb/create_lb_policy.py
@@ -1,5 +1,5 @@
-from libcloud.compute.types import Provider
-from libcloud.compute.providers import get_driver
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.providers import get_driver
 
 ACCESS_ID = 'your access id'
 SECRET_KEY = 'your secret key'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/loadbalancer/elb/create_load_balancer.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/elb/create_load_balancer.py b/docs/examples/loadbalancer/elb/create_load_balancer.py
index 2673577..838e862 100644
--- a/docs/examples/loadbalancer/elb/create_load_balancer.py
+++ b/docs/examples/loadbalancer/elb/create_load_balancer.py
@@ -1,6 +1,6 @@
 from libcloud.loadbalancer.base import Member, Algorithm
-from libcloud.compute.types import Provider
-from libcloud.compute.providers import get_driver
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.providers import get_driver
 
 ACCESS_ID = 'your access id'
 SECRET_KEY = 'your secret key'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py b/docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py
index d735d3a..a6375a1 100644
--- a/docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py
+++ b/docs/examples/loadbalancer/elb/ex_create_balancer_listeners.py
@@ -1,5 +1,5 @@
-from libcloud.compute.types import Provider
-from libcloud.compute.providers import get_driver
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.providers import get_driver
 
 ACCESS_ID = 'your access id'
 SECRET_KEY = 'your secret key'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/loadbalancer/elb/ex_delete_balancer_policy.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/elb/ex_delete_balancer_policy.py b/docs/examples/loadbalancer/elb/ex_delete_balancer_policy.py
index d041c6f..853795d 100644
--- a/docs/examples/loadbalancer/elb/ex_delete_balancer_policy.py
+++ b/docs/examples/loadbalancer/elb/ex_delete_balancer_policy.py
@@ -1,5 +1,5 @@
-from libcloud.compute.types import Provider
-from libcloud.compute.providers import get_driver
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.providers import get_driver
 
 ACCESS_ID = 'your access id'
 SECRET_KEY = 'your secret key'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/loadbalancer/elb/ex_list_balancer_policies.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/elb/ex_list_balancer_policies.py b/docs/examples/loadbalancer/elb/ex_list_balancer_policies.py
index 1356df1..be11455 100644
--- a/docs/examples/loadbalancer/elb/ex_list_balancer_policies.py
+++ b/docs/examples/loadbalancer/elb/ex_list_balancer_policies.py
@@ -1,5 +1,5 @@
-from libcloud.compute.types import Provider
-from libcloud.compute.providers import get_driver
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.providers import get_driver
 
 ACCESS_ID = 'your access id'
 SECRET_KEY = 'your secret key'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py b/docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py
index 198a9f2..c8ffb16 100644
--- a/docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py
+++ b/docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py
@@ -1,5 +1,5 @@
-from libcloud.compute.types import Provider
-from libcloud.compute.providers import get_driver
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.providers import get_driver
 
 ACCESS_ID = 'your access id'
 SECRET_KEY = 'your secret key'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/loadbalancer/elb/ex_set_balancer_policies_backend_server.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/elb/ex_set_balancer_policies_backend_server.py b/docs/examples/loadbalancer/elb/ex_set_balancer_policies_backend_server.py
index 5168040..e783bc4 100644
--- a/docs/examples/loadbalancer/elb/ex_set_balancer_policies_backend_server.py
+++ b/docs/examples/loadbalancer/elb/ex_set_balancer_policies_backend_server.py
@@ -1,5 +1,5 @@
-from libcloud.compute.types import Provider
-from libcloud.compute.providers import get_driver
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.providers import get_driver
 
 ACCESS_ID = 'your access id'
 SECRET_KEY = 'your secret key'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/loadbalancer/elb/ex_set_balancer_policies_listener.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/elb/ex_set_balancer_policies_listener.py b/docs/examples/loadbalancer/elb/ex_set_balancer_policies_listener.py
index 2abfa86..841eae9 100644
--- a/docs/examples/loadbalancer/elb/ex_set_balancer_policies_listener.py
+++ b/docs/examples/loadbalancer/elb/ex_set_balancer_policies_listener.py
@@ -1,5 +1,5 @@
-from libcloud.compute.types import Provider
-from libcloud.compute.providers import get_driver
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.providers import get_driver
 
 ACCESS_ID = 'your access id'
 SECRET_KEY = 'your secret key'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/loadbalancer/elb/list_load_balancer.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/elb/list_load_balancer.py b/docs/examples/loadbalancer/elb/list_load_balancer.py
index 5b5c834..84e6728 100644
--- a/docs/examples/loadbalancer/elb/list_load_balancer.py
+++ b/docs/examples/loadbalancer/elb/list_load_balancer.py
@@ -1,5 +1,5 @@
-from libcloud.compute.types import Provider
-from libcloud.compute.providers import get_driver
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.providers import get_driver
 
 ACCESS_ID = 'your access id'
 SECRET_KEY = 'your secret key'

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/misc/twisted_create_node.py
----------------------------------------------------------------------
diff --git a/docs/examples/misc/twisted_create_node.py b/docs/examples/misc/twisted_create_node.py
index e0109e1..eb3d8b9 100644
--- a/docs/examples/misc/twisted_create_node.py
+++ b/docs/examples/misc/twisted_create_node.py
@@ -2,6 +2,7 @@ from __future__ import absolute_import
 
 from pprint import pprint
 
+# pylint: disable=import-error
 from twisted.internet import defer, threads, reactor
 from libcloud.compute.types import Provider
 from libcloud.compute.providers import get_driver
@@ -28,7 +29,7 @@ def stop(*args, **kwargs):
     reactor.stop()
 
 d = create_node(name='my-lc-node')
-d.addCallback(stop)
-d.addErrback(stop)
+d.addCallback(stop)  # pylint: disable=no-member
+d.addErrback(stop)  # pylint: disable=no-member
 
 reactor.run()

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c9d0a460/docs/examples/storage/concurrent_file_download_using_gevent.py
----------------------------------------------------------------------
diff --git a/docs/examples/storage/concurrent_file_download_using_gevent.py b/docs/examples/storage/concurrent_file_download_using_gevent.py
index 3bd9083..2da2909 100644
--- a/docs/examples/storage/concurrent_file_download_using_gevent.py
+++ b/docs/examples/storage/concurrent_file_download_using_gevent.py
@@ -1,7 +1,7 @@
 import os.path
 
-from gevent import monkey
-from gevent.pool import Pool
+from gevent import monkey  # pylint: disable=import-error
+from gevent.pool import Pool  # pylint: disable=import-error
 monkey.patch_all()
 
 from libcloud.storage.providers import get_driver


Mime
View raw message