From 29f3a1caaa699e0f042b281d03d156fb53a0fb7d Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Fri, 14 Dec 2018 16:07:01 -0600 Subject: [PATCH] Cleanup pep8 H401 docstring warnings This is a minor code cleanup task. No longer suppress the following flake8 warning H401 docstring should not start with a space This change only affects docstrings and therefore has no runtime impact. Story: 2004515 Task: 28527 Change-Id: I8b1e22ebdfd9f0400535930de4829635364e2299 Signed-off-by: Al Bailey --- .../alarm/handlers/v1/_alarm_handler.py | 18 +++++++++--------- .../nfv_common/catalog/_catalog_backend.py | 8 ++++---- .../nfv_common/catalog/_catalog_module.py | 6 +++--- .../catalog/plugin/v1/_catalog_plugin.py | 14 +++++++------- .../handlers/v1/_event_log_handler.py | 14 +++++++------- nfv/nfv-common/nfv_common/helpers.py | 2 +- nfv/tox.ini | 3 +-- 7 files changed, 32 insertions(+), 33 deletions(-) diff --git a/nfv/nfv-common/nfv_common/alarm/handlers/v1/_alarm_handler.py b/nfv/nfv-common/nfv_common/alarm/handlers/v1/_alarm_handler.py index bd4336c8..86e4b409 100755 --- a/nfv/nfv-common/nfv_common/alarm/handlers/v1/_alarm_handler.py +++ b/nfv/nfv-common/nfv_common/alarm/handlers/v1/_alarm_handler.py @@ -14,45 +14,45 @@ class AlarmHandler(object): """ @abc.abstractproperty def name(self): - """ The name of handler """ + """The name of handler """ pass @abc.abstractproperty def version(self): - """ The versions of the handler """ + """The versions of the handler """ pass @abc.abstractproperty def provider(self): - """ Who created the handler """ + """Who created the handler """ pass @abc.abstractproperty def signature(self): - """ Signature of the handler """ + """Signature of the handler """ pass @abc.abstractmethod def raise_alarm(self, alarm_uuid, alarm_data): - """ Raise an alarm via the handler """ + """Raise an alarm via the handler """ pass @abc.abstractmethod def clear_alarm(self, alarm_uuid): - """ Clear an alarm via the handler """ + """Clear an alarm via the handler """ pass @abc.abstractmethod def audit_alarms(self): - """ Audit alarms via the handler """ + """Audit alarms via the handler """ pass @abc.abstractmethod def initialize(self, config_file): - """ Initialize the handler """ + """Initialize the handler """ pass @abc.abstractmethod def finalize(self): - """ Finalize the handler """ + """Finalize the handler """ pass diff --git a/nfv/nfv-common/nfv_common/catalog/_catalog_backend.py b/nfv/nfv-common/nfv_common/catalog/_catalog_backend.py index 7394e2b4..2993f06f 100755 --- a/nfv/nfv-common/nfv_common/catalog/_catalog_backend.py +++ b/nfv/nfv-common/nfv_common/catalog/_catalog_backend.py @@ -36,7 +36,7 @@ class CatalogBackend(stevedore.named.NamedExtensionManager): @staticmethod def valid_plugin(plugin): - """ Verify signature of plugin is valid """ + """Verify signature of plugin is valid """ if CatalogBackend._signature == plugin.obj.signature: return True else: @@ -46,7 +46,7 @@ class CatalogBackend(stevedore.named.NamedExtensionManager): return False def read_vnf_descriptor(self, vnfd_id, vnf_vendor, vnf_version): - """ Read a particular vnf descriptor """ + """Read a particular vnf descriptor """ vnfd_record = None if self.plugin is not None: vnfd_record = self.plugin.obj.read_vnf_descriptor(vnfd_id, @@ -55,11 +55,11 @@ class CatalogBackend(stevedore.named.NamedExtensionManager): return vnfd_record def initialize(self): - """ Initialize plugin """ + """Initialize plugin """ if self.plugin is not None: self.plugin.obj.initialize(self._version) def finalize(self): - """ Finalize plugin """ + """Finalize plugin """ if self.plugin is not None: self.plugin.obj.finalize() diff --git a/nfv/nfv-common/nfv_common/catalog/_catalog_module.py b/nfv/nfv-common/nfv_common/catalog/_catalog_module.py index 9b59512b..cafcd7e7 100755 --- a/nfv/nfv-common/nfv_common/catalog/_catalog_module.py +++ b/nfv/nfv-common/nfv_common/catalog/_catalog_module.py @@ -9,7 +9,7 @@ _catalog_backend = None def read_vnf_descriptor(vnfd_id, vnf_vendor, vnf_version): - """ Read a vnf descriptor """ + """Read a vnf descriptor """ if _catalog_backend is not None: return _catalog_backend.read_vnf_descriptor(vnfd_id, vnf_vendor, vnf_version) @@ -17,12 +17,12 @@ def read_vnf_descriptor(vnfd_id, vnf_vendor, vnf_version): def catalog_initialize(plugin_namespace, plugin_name): - """ Catalog Initialize """ + """Catalog Initialize """ global _catalog_backend _catalog_backend = CatalogBackend(plugin_namespace, plugin_name) def catalog_finalize(): - """ Catalog Finalize """ + """Catalog Finalize """ global _catalog_backend _catalog_backend = None diff --git a/nfv/nfv-common/nfv_common/catalog/plugin/v1/_catalog_plugin.py b/nfv/nfv-common/nfv_common/catalog/plugin/v1/_catalog_plugin.py index 63c886f9..69849014 100755 --- a/nfv/nfv-common/nfv_common/catalog/plugin/v1/_catalog_plugin.py +++ b/nfv/nfv-common/nfv_common/catalog/plugin/v1/_catalog_plugin.py @@ -17,35 +17,35 @@ class CatalogPlugin(object): """ @abstractproperty def name(self): - """ The name of plugin """ + """The name of plugin """ pass @abstractproperty def version(self): - """ The versions of the plugin """ + """The versions of the plugin """ pass @abstractproperty def provider(self): - """ Vendor created the plugin """ + """Vendor created the plugin """ pass @abstractproperty def signature(self): - """ Signature of the plugin """ + """Signature of the plugin """ pass @abstractmethod def read_vnf_descriptor(self, vnfd_id, vnf_vendor, vnf_version): - """ Read a particular vnf descriptor """ + """Read a particular vnf descriptor """ pass @abstractmethod def initialize(self, version): - """ Initialize the plugin """ + """Initialize the plugin """ pass @abstractmethod def finalize(self): - """ Finalize the plugin """ + """Finalize the plugin """ pass diff --git a/nfv/nfv-common/nfv_common/event_log/handlers/v1/_event_log_handler.py b/nfv/nfv-common/nfv_common/event_log/handlers/v1/_event_log_handler.py index 6fe78272..9be1ce85 100755 --- a/nfv/nfv-common/nfv_common/event_log/handlers/v1/_event_log_handler.py +++ b/nfv/nfv-common/nfv_common/event_log/handlers/v1/_event_log_handler.py @@ -14,35 +14,35 @@ class EventLogHandler(object): """ @abc.abstractproperty def name(self): - """ The name of handler """ + """The name of handler """ pass @abc.abstractproperty def version(self): - """ The versions of the handler """ + """The versions of the handler """ pass @abc.abstractproperty def provider(self): - """ Who created the handler """ + """Who created the handler """ pass @abc.abstractproperty def signature(self): - """ Signature of the handler """ + """Signature of the handler """ pass @abc.abstractmethod def log(self, log_data): - """ Log an event via the handler """ + """Log an event via the handler """ pass @abc.abstractmethod def initialize(self, config_file): - """ Initialize the handler """ + """Initialize the handler """ pass @abc.abstractmethod def finalize(self): - """ Finalize the handler """ + """Finalize the handler """ pass diff --git a/nfv/nfv-common/nfv_common/helpers.py b/nfv/nfv-common/nfv_common/helpers.py index f85e49e9..376452e6 100755 --- a/nfv/nfv-common/nfv_common/helpers.py +++ b/nfv/nfv-common/nfv_common/helpers.py @@ -10,7 +10,7 @@ import functools def syscall_retry_on_interrupt(func, *args): - """ Attempt system call again if interrupted by EINTR """ + """Attempt system call again if interrupted by EINTR """ for _ in range(0, 5): try: return func(*args) diff --git a/nfv/tox.ini b/nfv/tox.ini index b13838f5..b9d0f23a 100755 --- a/nfv/tox.ini +++ b/nfv/tox.ini @@ -68,7 +68,6 @@ verbosity=2 # - hacking codes - # H104: File contains nothing but comments # H306: imports not in alphabetical order -# H401: docstring should not start with a space # H404: multi line docstring should start without a leading new line # H405: multi line docstring summary not separated with an empty line # H501: Do not use self.__dict__ for string formatting @@ -77,7 +76,7 @@ verbosity=2 # - bugbear codes - # B007 Loop control variable 'X' not used within the loop body. If this is intended, start the name with an underscore. ignore = E121,E122,E123,E124,E126,E127,E128,E129,E501, - H104,H306,H401,H404,H405,H501, + H104,H306,H404,H405,H501, F821, B007 # H106 Don’t put vim configuration in source files (off by default).