From 46e0093b24c3f4b9c13dd3ade2f0ea4bd233a53d Mon Sep 17 00:00:00 2001 From: Mark McClain Date: Wed, 19 Nov 2014 17:30:10 -0500 Subject: [PATCH] enable H401 hacking check This change corrects H401 (docstring should not start with a space) errors and enables the check Change-Id: I2f798421d5895fcec349c757d27b7f085ee001e7 Partial-Bug: 1329017 --- neutron/db/l3_dvrscheduler_db.py | 2 +- neutron/plugins/bigswitch/routerrule_db.py | 2 +- neutron/plugins/ml2/drivers/arista/arista_l3_driver.py | 2 +- neutron/plugins/ml2/drivers/freescale/config.py | 4 ++-- neutron/plugins/sriovnicagent/sriov_nic_agent.py | 2 +- neutron/services/l3_router/brocade/l3_router_plugin.py | 4 ++-- tox.ini | 3 +-- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/neutron/db/l3_dvrscheduler_db.py b/neutron/db/l3_dvrscheduler_db.py index d717b0d5d0..c2a8aacf34 100644 --- a/neutron/db/l3_dvrscheduler_db.py +++ b/neutron/db/l3_dvrscheduler_db.py @@ -282,7 +282,7 @@ class L3_DVRsch_db_mixin(l3agent_sch_db.L3AgentSchedulerDbMixin): 'agent %(id)s', {'router_id': router_id, 'id': agent_id}) def get_snat_bindings(self, context, router_ids): - """ Retrieves the dvr snat bindings for a router.""" + """Retrieves the dvr snat bindings for a router.""" if not router_ids: return [] query = context.session.query(CentralizedSnatL3AgentBinding) diff --git a/neutron/plugins/bigswitch/routerrule_db.py b/neutron/plugins/bigswitch/routerrule_db.py index d6dcc08c10..8bdbe7276b 100644 --- a/neutron/plugins/bigswitch/routerrule_db.py +++ b/neutron/plugins/bigswitch/routerrule_db.py @@ -46,7 +46,7 @@ class NextHop(model_base.BASEV2): class RouterRule_db_mixin(l3_db.L3_NAT_db_mixin): - """ Mixin class to support route rule configuration on a router""" + """Mixin class to support route rule configuration on a router.""" def update_router(self, context, id, router): r = router['router'] with context.session.begin(subtransactions=True): diff --git a/neutron/plugins/ml2/drivers/arista/arista_l3_driver.py b/neutron/plugins/ml2/drivers/arista/arista_l3_driver.py index 0d3190eddc..36b19be90c 100644 --- a/neutron/plugins/ml2/drivers/arista/arista_l3_driver.py +++ b/neutron/plugins/ml2/drivers/arista/arista_l3_driver.py @@ -408,7 +408,7 @@ class AristaL3Driver(object): return socket.inet_ntop(socket.AF_INET6, struct.pack("!QQ", hi, lo)) def _get_router_ip(self, cidr, ip_count, ip_ver): - """ For a given IP subnet and IP version type, generate IP for router. + """For a given IP subnet and IP version type, generate IP for router. This method takes the network address (cidr) and selects an IP address that should be assigned to virtual router running diff --git a/neutron/plugins/ml2/drivers/freescale/config.py b/neutron/plugins/ml2/drivers/freescale/config.py index 7739dc1ab9..fe1b3c6fa2 100644 --- a/neutron/plugins/ml2/drivers/freescale/config.py +++ b/neutron/plugins/ml2/drivers/freescale/config.py @@ -16,7 +16,7 @@ from neutronclient.v2_0 import client from oslo.config import cfg -""" Freescale CRD Server Configuration used by ML2 Mechanism Driver. +"""Freescale CRD Server Configuration used by ML2 Mechanism Driver. The following configuration is used by Freescale Drivers/Plugin like, FWaaS Plugin, VPNaaS Plugin etc.. which connect to Cloud Resource @@ -68,7 +68,7 @@ SERVICE_TYPE = 'crd' def get_crdclient(): - """ Using the CRD configuration, get and return CRD Client instance.""" + """Using the CRD configuration, get and return CRD Client instance.""" crd_client_params = { 'username': FSLCONF.crd_user_name, 'tenant_name': FSLCONF.crd_tenant_name, diff --git a/neutron/plugins/sriovnicagent/sriov_nic_agent.py b/neutron/plugins/sriovnicagent/sriov_nic_agent.py index dbfc03c73f..c11bf6db77 100644 --- a/neutron/plugins/sriovnicagent/sriov_nic_agent.py +++ b/neutron/plugins/sriovnicagent/sriov_nic_agent.py @@ -306,7 +306,7 @@ class SriovNicAgentConfigParser(object): self._validate() def _validate(self): - """ Validate configuration. + """Validate configuration. Validate that network_device in excluded_device exists in device mappings diff --git a/neutron/services/l3_router/brocade/l3_router_plugin.py b/neutron/services/l3_router/brocade/l3_router_plugin.py index 1826b83a6a..78c920ea0c 100644 --- a/neutron/services/l3_router/brocade/l3_router_plugin.py +++ b/neutron/services/l3_router/brocade/l3_router_plugin.py @@ -73,7 +73,7 @@ class BrocadeSVIPlugin(router.L3RouterPlugin): LOG.info(_("rbridge id %s"), self._switch['rbridge_id']) def create_router(self, context, router): - """ creates a vrf on NOS device.""" + """Creates a vrf on NOS device.""" LOG.debug("BrocadeSVIPlugin.create_router called: ") with context.session.begin(subtransactions=True): new_router = super(BrocadeSVIPlugin, self).create_router(context, @@ -98,7 +98,7 @@ class BrocadeSVIPlugin(router.L3RouterPlugin): return new_router def delete_router(self, context, router_id): - """ delete a vrf on NOS device.""" + """Delete a vrf on NOS device.""" router = super(BrocadeSVIPlugin, self).get_router(context, router_id) super(BrocadeSVIPlugin, self).delete_router(context, router_id) diff --git a/tox.ini b/tox.ini index d38ef0cdf5..ee77332f12 100644 --- a/tox.ini +++ b/tox.ini @@ -67,12 +67,11 @@ commands = python setup.py build_sphinx # E265 block comment should start with ‘# ‘ # H305 imports not grouped correctly # H307 like imports should be grouped together -# H401 docstring should not start with a space # H402 one line docstring needs punctuation # H405 multi line docstring summary not separated with an empty line # H904 Wrap long lines in parentheses instead of a backslash # TODO(marun) H404 multi line docstring should start with a summary -ignore = E125,E126,E128,E129,E265,H305,H307,H401,H402,H404,H405,H904 +ignore = E125,E126,E128,E129,E265,H305,H307,H402,H404,H405,H904 show-source = true builtins = _ exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,.ropeproject,rally-scenarios