From aee61ac85ec4628ae1a14186c19490e6fa7f6116 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Tue, 9 Oct 2018 20:00:27 -0400 Subject: [PATCH] Fix flake8 E405 errors Fix E405 error and start enforcing it. Trivialfix Change-Id: I6a55102d03bbcdd5c0c3a5cc75aea0ca37578117 --- neutron_tempest_plugin/api/test_dhcp_ipv6.py | 4 +++- neutron_tempest_plugin/common/ssh.py | 3 +-- neutron_tempest_plugin/scenario/admin/test_floatingip.py | 4 +++- neutron_tempest_plugin/scenario/base.py | 4 ++-- neutron_tempest_plugin/scenario/test_qos.py | 3 +-- neutron_tempest_plugin/scenario/test_security_groups.py | 5 ++++- tox.ini | 3 +-- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/neutron_tempest_plugin/api/test_dhcp_ipv6.py b/neutron_tempest_plugin/api/test_dhcp_ipv6.py index 0fab75cd..4f2e5764 100644 --- a/neutron_tempest_plugin/api/test_dhcp_ipv6.py +++ b/neutron_tempest_plugin/api/test_dhcp_ipv6.py @@ -82,7 +82,9 @@ class NetworksTestDHCPv6(base.BaseNetworkTest): @decorators.idempotent_id('98244d88-d990-4570-91d4-6b25d70d08af') def test_dhcp_stateful_fixedips_outrange(self): - """When port gets IP address from fixed IP range it + """Test DHCP Stateful fixed IPs out of range + + When port gets IP address from fixed IP range it shall be checked if it's from subnets range. """ kwargs = {'ipv6_ra_mode': 'dhcpv6-stateful', diff --git a/neutron_tempest_plugin/common/ssh.py b/neutron_tempest_plugin/common/ssh.py index 9812f4c3..4829db27 100644 --- a/neutron_tempest_plugin/common/ssh.py +++ b/neutron_tempest_plugin/common/ssh.py @@ -146,8 +146,7 @@ class Client(ssh.Client): _get_ssh_connection = connect def close(self): - """Closes connection to SSH server and cleanup resources. - """ + """Closes connection to SSH server and cleanup resources.""" client = self._client if client is not None: client.close() diff --git a/neutron_tempest_plugin/scenario/admin/test_floatingip.py b/neutron_tempest_plugin/scenario/admin/test_floatingip.py index 2dc0da8a..1af55029 100644 --- a/neutron_tempest_plugin/scenario/admin/test_floatingip.py +++ b/neutron_tempest_plugin/scenario/admin/test_floatingip.py @@ -95,7 +95,9 @@ class FloatingIpTestCasesAdmin(base.BaseTempestTestCase): @decorators.idempotent_id('6bba729b-3fb6-494b-9e1e-82bbd89a1045') def test_two_vms_fips(self): - """This test verifies the ability of two instances + """Test two VMs floating IPs + + This test verifies the ability of two instances that were created in the same compute node and same availability zone to reach each other. """ diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py index 1aaf8ce8..a2c5c721 100644 --- a/neutron_tempest_plugin/scenario/base.py +++ b/neutron_tempest_plugin/scenario/base.py @@ -40,6 +40,7 @@ class BaseTempestTestCase(base_api.BaseNetworkTest): def create_server(self, flavor_ref, image_ref, key_name, networks, **kwargs): """Create a server using tempest lib + All the parameters are the ones used in Compute API * - Kwargs that require admin privileges @@ -134,8 +135,7 @@ class BaseTempestTestCase(base_api.BaseNetworkTest): @classmethod def create_pingable_secgroup_rule(cls, secgroup_id=None, client=None): - """This rule is intended to permit inbound ping - """ + """This rule is intended to permit inbound ping""" rule_list = [{'protocol': 'icmp', 'direction': 'ingress', diff --git a/neutron_tempest_plugin/scenario/test_qos.py b/neutron_tempest_plugin/scenario/test_qos.py index 702bbaa9..6febb796 100644 --- a/neutron_tempest_plugin/scenario/test_qos.py +++ b/neutron_tempest_plugin/scenario/test_qos.py @@ -49,8 +49,7 @@ def _try_connect(host_ip, port): def _connect_socket(host, port): - """Try to initiate a connection to a host using an ip address - and a port. + """Try to initiate a connection to a host using an ip address and a port. Trying couple of times until a timeout is reached in case the listening host is not ready yet. diff --git a/neutron_tempest_plugin/scenario/test_security_groups.py b/neutron_tempest_plugin/scenario/test_security_groups.py index a764a494..ebdcf93a 100644 --- a/neutron_tempest_plugin/scenario/test_security_groups.py +++ b/neutron_tempest_plugin/scenario/test_security_groups.py @@ -43,6 +43,7 @@ class NetworkSecGroupTest(base.BaseTempestTestCase): def create_vm_testing_sec_grp(self, num_servers=2, security_groups=None, ports=None): """Create instance for security group testing + :param num_servers (int): number of servers to spawn :param security_groups (list): list of security groups :param ports* (list): list of ports @@ -260,7 +261,9 @@ class NetworkSecGroupTest(base.BaseTempestTestCase): @decorators.idempotent_id('f07d0159-8f9e-4faa-87f5-a869ab0ad488') def test_multiple_ports_secgroup_inheritance(self): - """This test creates two ports with security groups, then + """Test multiple port security group inheritance + + This test creates two ports with security groups, then boots two instances and verify that the security group was inherited properly and enforced in these instances. """ diff --git a/tox.ini b/tox.ini index 36cec5b9..82a473c6 100644 --- a/tox.ini +++ b/tox.ini @@ -56,9 +56,8 @@ commands = oslo_debug_helper -t neutron_tempest_plugin/ {posargs} # E126 continuation line over-indented for hanging indent # E128 continuation line under-indented for visual indent # E129 visually indented line with same indent as next logical line -# H405 multi line docstring summary not separated with an empty line # N530 direct neutron imports not allowed -ignore = E125,E126,E128,E129,H405,N530 +ignore = E125,E126,E128,E129,N530 # H106: Don't put vim configuration in source files # H203: Use assertIs(Not)None to check for None # H904: Delay string interpolations at logging calls