From abd45876821362d343fc8db96efabf1314f455bf Mon Sep 17 00:00:00 2001 From: Eric Barrett Date: Thu, 18 Apr 2019 09:11:20 -0400 Subject: [PATCH] Enable Flake8 Docstring Errors Flake8 currently ignores the following errors: 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 Enable them for more consistent formatting of docstrings Change-Id: I385e28e9c6eca3c02a3def51ff64b00b7a63a853 Story: 2004515 Task: 30076 Signed-off-by: Eric Barrett --- ceph/ceph-manager/ceph-manager/ceph_manager/ceph.py | 2 ++ ceph/ceph-manager/ceph-manager/ceph_manager/monitor.py | 4 ++-- utilities/logmgmt/logmgmt/logmgmt/logmgmt.py | 8 ++------ .../platform-util/platform_util/license/exception.py | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ceph/ceph-manager/ceph-manager/ceph_manager/ceph.py b/ceph/ceph-manager/ceph-manager/ceph_manager/ceph.py index 50e15993..68260ce2 100644 --- a/ceph/ceph-manager/ceph-manager/ceph_manager/ceph.py +++ b/ceph/ceph-manager/ceph-manager/ceph_manager/ceph.py @@ -15,6 +15,7 @@ LOG = logging.getLogger(__name__) def osd_pool_set_quota(ceph_api, pool_name, max_bytes=0, max_objects=0): """Set the quota for an OSD pool_name + Setting max_bytes or max_objects to 0 will disable that quota param :param pool_name: OSD pool_name :param max_bytes: maximum bytes for OSD pool_name @@ -112,6 +113,7 @@ def osd_pool_create(ceph_api, pool_name, pg_num, pgp_num): def osd_pool_delete(ceph_api, pool_name): """Delete an osd pool + :param pool_name: pool name """ response, body = ceph_api.osd_pool_delete( diff --git a/ceph/ceph-manager/ceph-manager/ceph_manager/monitor.py b/ceph/ceph-manager/ceph-manager/ceph_manager/monitor.py index aef26b22..b06e7577 100644 --- a/ceph/ceph-manager/ceph-manager/ceph_manager/monitor.py +++ b/ceph/ceph-manager/ceph-manager/ceph_manager/monitor.py @@ -665,7 +665,7 @@ class Monitor(HandleUpgradesMixin): @staticmethod def _parse_reason(health): - """ Parse reason strings received from Ceph """ + """Parse reason strings received from Ceph""" if health['health'] in constants.CEPH_STATUS_CUSTOM: # Don't parse reason messages that we added return "Storage Alarm Condition: %(health)s. %(detail)s" % health @@ -864,7 +864,7 @@ class Monitor(HandleUpgradesMixin): alarm_list[alarm].entity_instance_id) def _get_current_alarms(self): - """ Retrieve currently raised alarm """ + """Retrieve currently raised alarm""" self.current_health_alarm = self.service.fm_api.get_fault( fm_constants.FM_ALARM_ID_STORAGE_CEPH, self.service.entity_instance_id) diff --git a/utilities/logmgmt/logmgmt/logmgmt/logmgmt.py b/utilities/logmgmt/logmgmt/logmgmt/logmgmt.py index 4b01c9b5..fe5e83c3 100644 --- a/utilities/logmgmt/logmgmt/logmgmt/logmgmt.py +++ b/utilities/logmgmt/logmgmt/logmgmt/logmgmt.py @@ -48,9 +48,7 @@ def start_polling(): def handle_exception(exc_type, exc_value, exc_traceback): - """ - Exception handler to log any uncaught exceptions - """ + """Exception handler to log any uncaught exceptions""" logging.error("Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback)) sys.__excepthook__(exc_type, exc_value, exc_traceback) @@ -60,9 +58,7 @@ def handle_exception(exc_type, exc_value, exc_traceback): # CLASSES ################### class LogMgmtDaemon(): - """ Daemon process representation of - the /var/log monitoring program - """ + """Daemon process representation of the /var/log monitoring program""" def __init__(self): # Daemon-specific init self.stdin_path = '/dev/null' diff --git a/utilities/platform-util/platform-util/platform_util/license/exception.py b/utilities/platform-util/platform-util/platform_util/license/exception.py index 58e88bc6..b940d4c6 100644 --- a/utilities/platform-util/platform-util/platform_util/license/exception.py +++ b/utilities/platform-util/platform-util/platform_util/license/exception.py @@ -6,7 +6,7 @@ class ValidateError(Exception): - """Base class for license validation exceptions.""" + """Base class for license validation exceptions""" def __init__(self, message=None): self.message = message