]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Use comments rather than no-op string statements
authorAngus Lees <gus@inodes.org>
Mon, 25 Aug 2014 02:26:00 +0000 (12:26 +1000)
committerAngus Lees <gus@inodes.org>
Mon, 8 Dec 2014 21:40:32 +0000 (08:40 +1100)
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

.pylintrc
neutron/hacking/checks.py
neutron/plugins/cisco/network_plugin.py
neutron/plugins/midonet/plugin.py
neutron/plugins/ml2/drivers/arista/config.py
neutron/plugins/ml2/drivers/freescale/config.py
neutron/plugins/nec/db/models.py
neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py

index a126b935d217ac1c9b2c99d88dffc622c6c0dd1a..d343d72a641b0bb55cdcbb87baa58568b61407a6 100644 (file)
--- a/.pylintrc
+++ b/.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,
index 998f345a9139183c3d987eae7b84cd1e1cc41eb0..941507495827ff865a695f157829fe64883ec408 100644 (file)
@@ -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*('|\")")
index b8c48769fb2cf0c937b04f028627c4da840b2abd..2b07c818771be56970dfc41999fcfdf33b51d00c 100644 (file)
@@ -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")
index 9c2d4aa06c45790693c3e8696178f0ed0e1cb844..b538625fe793505597c7897489661dc005ce382a 100644 (file)
@@ -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:
index 03c695acb6abe33e17ed384ddf6525ffab60894c..2f38989c9b11112d27cdfdcd8e1dd1b1608db69e 100644 (file)
 
 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',
index fe1b3c6fa2dfd38009d82e4670d8ae7ba80eb5e1..e1e11e1427522bafb971af6034e82890deadb320 100644 (file)
 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 = [
index 965a04e8e457f512d13c6168c2be0609ba8017c9..b351c3a957c0d9039a2cb6b821afd3b715631923 100644 (file)
@@ -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):
index 35ec29745cfa65a7b2d13429592c4bb3bae15cea..a289224a00c22748a45e655f44f355090b2ae3a4 100644 (file)
@@ -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