Browse Source

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 <eric.barrett@windriver.com>
changes/20/680920/1
Eric Barrett 3 years ago
parent
commit
abd4587682
  1. 2
      ceph/ceph-manager/ceph-manager/ceph_manager/ceph.py
  2. 4
      ceph/ceph-manager/ceph-manager/ceph_manager/monitor.py
  3. 8
      utilities/logmgmt/logmgmt/logmgmt/logmgmt.py
  4. 2
      utilities/platform-util/platform-util/platform_util/license/exception.py

2
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(

4
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)

8
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'

2
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

Loading…
Cancel
Save