Browse Source

Use comments rather than no-op string statements

This change replaces a few no-op string statements with regular
comments.  While there was no harm in the previous use of strings for
comments, this allows us to re-enable the corresponding pylint check
which may catch genuinely unintended cases.

Change-Id: I796a059292e26c4df75c54f095d9e20e99187c98
changes/86/129786/2
Angus Lees 7 years ago
parent
commit
cd5b3646c1
  1. 1
      .pylintrc
  2. 25
      neutron/hacking/checks.py
  3. 6
      neutron/plugins/cisco/network_plugin.py
  4. 2
      neutron/plugins/midonet/plugin.py
  5. 14
      neutron/plugins/ml2/drivers/arista/config.py
  6. 11
      neutron/plugins/ml2/drivers/freescale/config.py
  7. 2
      neutron/plugins/nec/db/models.py
  8. 6
      neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py

1
.pylintrc

@ -47,7 +47,6 @@ disable=
logging-not-lazy,
no-init,
non-parent-init-called,
pointless-string-statement,
protected-access,
redefined-builtin,
redefined-outer-name,

25
neutron/hacking/checks.py

@ -16,20 +16,17 @@ import re
import pep8
"""
Guidelines for writing new hacking checks
- Use only for Neutron specific tests. OpenStack general tests
should be submitted to the common 'hacking' module.
- Pick numbers in the range N3xx. Find the current test with
the highest allocated number and then pick the next value.
- Keep the test method code in the source file ordered based
on the N3xx value.
- List the new rule in the top level HACKING.rst file
- Add test cases for each new rule to
neutron/tests/unit/test_hacking.py
"""
# Guidelines for writing new hacking checks
#
# - Use only for Neutron specific tests. OpenStack general tests
# should be submitted to the common 'hacking' module.
# - Pick numbers in the range N3xx. Find the current test with
# the highest allocated number and then pick the next value.
# - Keep the test method code in the source file ordered based
# on the N3xx value.
# - List the new rule in the top level HACKING.rst file
# - Add test cases for each new rule to
# neutron/tests/unit/test_hacking.py
log_translation = re.compile(
r"(.)*LOG\.(audit|error|info|warn|warning|critical|exception)\(\s*('|\")")

6
neutron/plugins/cisco/network_plugin.py

@ -123,9 +123,9 @@ class PluginV2(db_base_plugin_v2.NeutronDbPluginV2):
"""
base.FAULT_MAP.update(self.CISCO_FAULT_MAP)
"""
Extension API implementation
"""
#
# Extension API implementation
#
def get_all_qoss(self, tenant_id):
"""Get all QoS levels."""
LOG.debug("get_all_qoss() called")

2
neutron/plugins/midonet/plugin.py

@ -590,7 +590,7 @@ class MidonetPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
LOG.debug("MidonetPluginV2.get_port called: id=%(id)s "
"fields=%(fields)r", {'id': id, 'fields': fields})
port = super(MidonetPluginV2, self).get_port(context, id, fields)
"Check if the port exists in MidoNet DB"""
# Check if the port exists in MidoNet DB
try:
self.client.get_port(id)
except midonet_lib.MidonetResourceNotFound as exc:

14
neutron/plugins/ml2/drivers/arista/config.py

@ -16,14 +16,14 @@
from oslo.config import cfg
""" Arista ML2 Mechanism driver specific configuration knobs.
Following are user configurable options for Arista ML2 Mechanism
driver. The eapi_username, eapi_password, and eapi_host are
required options. Region Name must be the same that is used by
Keystone service. This option is available to support multiple
OpenStack/Neutron controllers.
"""
# Arista ML2 Mechanism driver specific configuration knobs.
#
# Following are user configurable options for Arista ML2 Mechanism
# driver. The eapi_username, eapi_password, and eapi_host are
# required options. Region Name must be the same that is used by
# Keystone service. This option is available to support multiple
# OpenStack/Neutron controllers.
ARISTA_DRIVER_OPTS = [
cfg.StrOpt('eapi_username',

11
neutron/plugins/ml2/drivers/freescale/config.py

@ -16,12 +16,11 @@
from neutronclient.v2_0 import client
from oslo.config import cfg
"""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
Discovery Service (CRD).
"""
# 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
# Discovery Service (CRD).
# CRD service options required for FSL SDN OS Mech Driver
ml2_fslsdn_opts = [

2
neutron/plugins/nec/db/models.py

@ -19,7 +19,7 @@ from neutron.db import model_base
from neutron.db import models_v2
"""New mapping tables."""
# New mapping tables.
class OFCId(object):

6
neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py

@ -749,9 +749,9 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2,
except Exception as err_message:
raise plum_excep.PLUMgridException(err_msg=err_message)
"""
Internal PLUMgrid Functions
"""
#
# Internal PLUMgrid Functions
#
def _get_plugin_version(self):
return plugin_ver.VERSION

Loading…
Cancel
Save