libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [42/51] [abbrv] libcloud git commit: fixed lint checks in docs/examples/
Date Wed, 31 Oct 2018 03:11:53 GMT
fixed lint checks in docs/examples/


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

Branch: refs/heads/trunk
Commit: b2726338f4394448331bb93d25f60303245a302e
Parents: a977390
Author: mitch <mitch.raful@itaas.dimensiondata.com>
Authored: Thu Oct 25 13:07:44 2018 -0400
Committer: mitch <mitch.raful@itaas.dimensiondata.com>
Committed: Thu Oct 25 13:07:44 2018 -0400

----------------------------------------------------------------------
 .../Firewall_Create_Complex_Firewall_Rule.py     | 19 ++++++++++++-------
 .../nttcis/Firewall_Create_Simple_Rule.py        | 19 +++++++++++++------
 .../nttcis/Nodes_Create_mcp2_Customized.py       |  3 ++-
 .../nttcis/LoadBalancer_create_members.py        | 13 +++++++++----
 .../nttcis/Load_balancer_add_pool_mon.py         |  3 ++-
 5 files changed, 38 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/b2726338/docs/examples/compute/nttcis/Firewall_Create_Complex_Firewall_Rule.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/nttcis/Firewall_Create_Complex_Firewall_Rule.py b/docs/examples/compute/nttcis/Firewall_Create_Complex_Firewall_Rule.py
index c96a0ca..6eb58b0 100644
--- a/docs/examples/compute/nttcis/Firewall_Create_Complex_Firewall_Rule.py
+++ b/docs/examples/compute/nttcis/Firewall_Create_Complex_Firewall_Rule.py
@@ -1,8 +1,8 @@
-from pprint import pprint
+import libcloud.security
 from libcloud.compute.types import Provider
 from libcloud.compute.providers import get_driver
-from libcloud.common.nttcis import NttCisFirewallAddress, NttCisIpAddress, NttCisPort
-import libcloud.security
+from libcloud.common.nttcis import NttCisFirewallAddress,\
+    NttCisIpAddress, NttCisPort
 
 # Get nttcis driver
 libcloud.security.VERIFY_SSL_CERT = True
@@ -41,13 +41,17 @@ else:
     addr_list = driver.ex_list_ip_address_list(my_network_domain.id)
     addr_list = [al for al in addr_list if al.name == address_list_name][0]
 
-# Instead of a single port or list of ports, create a port list for the destianation
+# Instead of a single port or list of ports, create a port
+# list for the destianation
 port_list_name = 'sdk_test_port_list'
 description = 'A test port list'
 
 # rerquires an instance of NttCisPort object
 ports = [NttCisPort(begin='8000', end='8080')]
-result = driver.ex_create_portlist(my_network_domain.id, port_list_name, description, ports)
+result = driver.ex_create_portlist(my_network_domain.id,
+                                   port_list_name,
+                                   description,
+                                   ports)
 
 try:
     assert result is True
@@ -58,7 +62,8 @@ else:
     port_list = [pl for pl in port_list if pl.name == port_list_name][0]
 
 # Create an instance of NttCisFirewallAddress for destination
-dest_firewall_address = NttCisFirewallAddress(address_list_id=addr_list.id, port_list_id=port_list.id)
+dest_firewall_address = NttCisFirewallAddress(address_list_id=addr_list.id,
+                                              port_list_id=port_list.id)
 
 # Finally create firewall rule
 rule = driver.ex_create_firewall_rule(my_network_domain.id,
@@ -69,4 +74,4 @@ rule = driver.ex_create_firewall_rule(my_network_domain.id,
                                       source_firewall_address,
                                       dest_firewall_address,
                                       'LAST')
-print(rule)
\ No newline at end of file
+print(rule)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b2726338/docs/examples/compute/nttcis/Firewall_Create_Simple_Rule.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/nttcis/Firewall_Create_Simple_Rule.py b/docs/examples/compute/nttcis/Firewall_Create_Simple_Rule.py
index d19ffd8..b14b6db 100644
--- a/docs/examples/compute/nttcis/Firewall_Create_Simple_Rule.py
+++ b/docs/examples/compute/nttcis/Firewall_Create_Simple_Rule.py
@@ -1,7 +1,7 @@
 from pprint import pprint
 from libcloud.compute.types import Provider
 from libcloud.compute.providers import get_driver
-from libcloud.common.nttcis import NttCisFirewallAddress, NttCisIpAddress, NttCisPort
+from libcloud.common.nttcis import NttCisFirewallAddress
 import libcloud.security
 
 # Get nttcis driver
@@ -13,9 +13,16 @@ domain_name = 'sdk_test_1'
 domains = driver.ex_list_network_domains(location='EU6')
 net_domain = [d for d in domains if d.name == domain_name]
 source_firewall_address = NttCisFirewallAddress(any_ip='ANY')
-dest_firewall_address = NttCisFirewallAddress(ip_address='10.2.0.0', ip_prefix_size='16',
-                                              port_begin='8000', port_end='8080')
+dest_firewall_address = NttCisFirewallAddress(ip_address='10.2.0.0',
+                                              ip_prefix_size='16',
+                                              port_begin='8000',
+                                              port_end='8080')
 
-rule = driver.ex_create_firewall_rule(net_domain[0], 'sdk_test_firewall_rule_2', 'ACCEPT_DECISIVELY',
-                                      'IPV4', 'TCP', source_firewall_address, dest_firewall_address,
'LAST')
-pprint(rule)
\ No newline at end of file
+rule = driver.ex_create_firewall_rule(net_domain[0],
+                                      'sdk_test_firewall_rule_2',
+                                      'ACCEPT_DECISIVELY',
+                                      'IPV4', 'TCP',
+                                      source_firewall_address,
+                                      dest_firewall_address,
+                                      'LAST')
+pprint(rule)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b2726338/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py b/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py
index 8f89986..17bdf01 100644
--- a/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py
+++ b/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py
@@ -23,4 +23,5 @@ new_node = driver.create_node("Suse_12", image, psswd,
                               ex_primary_nic_network_adapter='VMXNET3',
                               ex_memory_gb=8
                               )
-driver.ex_wait_for_state('running', driver.ex_get_node_by_id, 20, 420, new_node.id)
\ No newline at end of file
+driver.ex_wait_for_state('running', driver.ex_get_node_by_id,
+                         20, 420, new_node.id)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b2726338/docs/examples/loadbalancer/nttcis/LoadBalancer_create_members.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/nttcis/LoadBalancer_create_members.py b/docs/examples/loadbalancer/nttcis/LoadBalancer_create_members.py
index 5ca8a38..60b8f4b 100644
--- a/docs/examples/loadbalancer/nttcis/LoadBalancer_create_members.py
+++ b/docs/examples/loadbalancer/nttcis/LoadBalancer_create_members.py
@@ -27,7 +27,12 @@ def create_load_balancer():
     algorithm = Algorithm.LEAST_CONNECTIONS_MEMBER
     members = [m for m in members]
     ex_listener_ip_address = "168.128.13.127"
-    lb = lbdriver.create_balancer(name, listener_port=listener_port, port=port, protocol=protocol,
-                                  algorithm=algorithm, members=members, optimization_profile='TCP',
-                                  ex_listener_ip_address=ex_listener_ip_address)
-    print(lb)
\ No newline at end of file
+    lb = lbdriver.create_balancer(
+        name,
+        listener_port=listener_port,
+        port=port, protocol=protocol,
+        algorithm=algorithm, members=members,
+        optimization_profile='TCP',
+        ex_listener_ip_address=ex_listener_ip_address
+    )
+    print(lb)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b2726338/docs/examples/loadbalancer/nttcis/Load_balancer_add_pool_mon.py
----------------------------------------------------------------------
diff --git a/docs/examples/loadbalancer/nttcis/Load_balancer_add_pool_mon.py b/docs/examples/loadbalancer/nttcis/Load_balancer_add_pool_mon.py
index 49179be..5474efd 100644
--- a/docs/examples/loadbalancer/nttcis/Load_balancer_add_pool_mon.py
+++ b/docs/examples/loadbalancer/nttcis/Load_balancer_add_pool_mon.py
@@ -37,5 +37,6 @@ for result in results:
     print(result)
 
 # Add desired health monitor
-result = update_health_monitors(lbdriver, net_domains[0], "9f79487a-1b6d-11e5-8d4f-180373fb68df")
+result = update_health_monitors(lbdriver, net_domains[0],
+                                "9f79487a-1b6d-11e5-8d4f-180373fb68df")
 assert result is True


Mime
View raw message