Enable Flake8 E12X Errors

Flake8 currently ignores the following Errors:
E121: continuation line under-indented for hanging indent
E123: closing bracket doesn't match indentation of opening bracket
E124: closing bracket doesn't match visual indentation
E125: continuation line with same indent as next logical line
E126: continuation line over-indented for hanging indent
E127: continuation line over-indented for visual indent
E128: continuation line under-indented for visual indent
Enable them for more consistent formatting of code

Change-Id: I415d4824a1f335ba3fceb488b0ae60b9861a036a
Story: 2004515
Task: 30076
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
This commit is contained in:
Eric Barrett 2019-03-29 08:59:40 -04:00
parent 2d1fe53be4
commit dc4fd1e39b
6 changed files with 31 additions and 32 deletions

View File

@ -33,13 +33,13 @@ class CephManagerException(Exception):
class CephPoolSetQuotaFailure(CephManagerException):
message = _("Error seting the OSD pool "
"quota %(name)s for %(pool)s to %(value)s") \
+ ": %(reason)s"
"quota %(name)s for %(pool)s to "
"%(value)s") + ": %(reason)s"
class CephPoolGetQuotaFailure(CephManagerException):
message = _("Error geting the OSD pool quota for %(pool)s") \
+ ": %(reason)s"
message = _("Error geting the OSD pool quota for "
"%(pool)s") + ": %(reason)s"
class CephPoolCreateFailure(CephManagerException):

View File

@ -140,9 +140,9 @@ class HandleUpgradesMixin(object):
# unsurpress require_jewel_osds in case upgrade
# is aborting
if (state in [
constants.UPGRADE_ABORTING,
constants.UPGRADE_ABORT_COMPLETING,
constants.UPGRADE_ABORTING_ROLLBACK]):
constants.UPGRADE_ABORTING,
constants.UPGRADE_ABORT_COMPLETING,
constants.UPGRADE_ABORTING_ROLLBACK]):
self.wait_for_upgrade_complete = False
return health

View File

@ -88,9 +88,9 @@ class BuddyInfo(object):
ret_string += " Zone: %s\n" % zoneinfo.get("zone")
ret_string += " Free KiB in zone: %.2f\n" % (sum(zoneinfo.get("usage")) / (1024.0))
ret_string += '\t{0:{align}{width}} {1:{align}{width}} {2:{align}{width}}\n'.format(
"Fragment size", "Free fragments", "Total available KiB",
width=width,
align="<")
"Fragment size", "Free fragments", "Total available KiB",
width=width,
align="<")
for idx in range(len(zoneinfo.get("sz_fragment"))):
ret_string += '\t{order:{align}{width}} {nr:{align}{width}} {usage:{align}{width}}\n'.format(
width=width,

View File

@ -90,9 +90,9 @@ class LogMgmtDaemon():
# Use python's log rotation, rather than logrotate
handler = logging.handlers.RotatingFileHandler(
LOG_FILE,
maxBytes=LOG_FILE_MAX_BYTES,
backupCount=LOG_FILE_BACKUP_COUNT)
LOG_FILE,
maxBytes=LOG_FILE_MAX_BYTES,
backupCount=LOG_FILE_BACKUP_COUNT)
my_logger = logging.getLogger()
my_logger.setLevel(level)
@ -147,10 +147,10 @@ class LogMgmtDaemon():
continue
# Ignore some files
if '/var/log/puppet' in fname \
or '/var/log/dmesg' in fname \
or '/var/log/rabbitmq' in fname \
or '/var/log/lastlog' in fname:
if ('/var/log/puppet' in fname
or '/var/log/dmesg' in fname
or '/var/log/rabbitmq' in fname
or '/var/log/lastlog' in fname):
continue
if os.path.exists(fname):

View File

@ -10,10 +10,9 @@ SPDX-License-Identifier: Apache-2.0
import setuptools
setuptools.setup(name='logmgmt',
version='1.0.0',
description='logmgmt',
license='Apache-2.0',
packages=['logmgmt'],
entry_points={
}
)
version='1.0.0',
description='logmgmt',
license='Apache-2.0',
packages=['logmgmt'],
entry_points={}
)

View File

@ -38,7 +38,7 @@ def get_licenses_info():
features = sm_common.flex_lm_license_get_feature_list()
if features.value:
feature_list = [feature for feature in features.value.split(',')
if feature.startswith(constants.FEATURE_PREFIX)]
if feature.startswith(constants.FEATURE_PREFIX)]
sm_common.flex_lm_license_free(features)
lc_attrs_list = []
@ -66,14 +66,14 @@ def get_licenses_info():
name = constants.LICENSE_MAP.get(feature)
if process_license and name:
lc_attrs = dict(name=name, status=status,
expiry_date=expiry_date)
expiry_date=expiry_date)
else:
lc_attrs = dict()
if lc_attrs:
license_name = lc_attrs.get('name')
if (not any(lc.get('name') == license_name
for lc in lc_attrs_list)):
for lc in lc_attrs_list)):
# Get the list of license attributes for all valid
# licenses and installed expired/invalid licenses
lc_attrs_list.append(lc_attrs)
@ -85,8 +85,8 @@ def get_licenses_info():
# not-installed licenses
for license_name in licenses:
lc_attrs = dict(name=license_name,
status=constants.NOT_INSTALLED,
expiry_date='-')
status=constants.NOT_INSTALLED,
expiry_date='-')
lc_attrs_list.append(lc_attrs)
# Return the list of license attributes
@ -145,7 +145,7 @@ def verify_feature_license(feature_name, feature_version=None):
# Return license attributes of a valid license
lc_attrs = dict(name=license_name, status=constants.INSTALLED,
expiry_date=expire_date_text.value)
expiry_date=expire_date_text.value)
return lc_attrs
@ -162,7 +162,7 @@ def verify_license(license_file):
features = sm_common.flex_lm_license_get_feature_list()
if features.value:
feature_list = [feature for feature in features.value.split(',')
if feature.startswith(constants.FEATURE_PREFIX)]
if feature.startswith(constants.FEATURE_PREFIX)]
sm_common.flex_lm_license_free(features)
# Validate license of each feature in the license file
@ -173,7 +173,7 @@ def verify_license(license_file):
if system_mode == sysinv_constants.SYSTEM_MODE_SIMPLEX:
product_license = constants.AIO_SIMPLEX_SYSTEM_LICENSES
elif (system_mode == sysinv_constants.SYSTEM_MODE_DUPLEX or
system_mode == sysinv_constants.SYSTEM_MODE_DUPLEX_DIRECT):
system_mode == sysinv_constants.SYSTEM_MODE_DUPLEX_DIRECT):
product_license = constants.AIO_SYSTEM_LICENSES
elif system_type == sysinv_constants.TIS_STD_BUILD:
product_license = constants.STD_SYSTEM_LICENSES