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:
parent
2d1fe53be4
commit
dc4fd1e39b
|
@ -33,13 +33,13 @@ class CephManagerException(Exception):
|
||||||
|
|
||||||
class CephPoolSetQuotaFailure(CephManagerException):
|
class CephPoolSetQuotaFailure(CephManagerException):
|
||||||
message = _("Error seting the OSD pool "
|
message = _("Error seting the OSD pool "
|
||||||
"quota %(name)s for %(pool)s to %(value)s") \
|
"quota %(name)s for %(pool)s to "
|
||||||
+ ": %(reason)s"
|
"%(value)s") + ": %(reason)s"
|
||||||
|
|
||||||
|
|
||||||
class CephPoolGetQuotaFailure(CephManagerException):
|
class CephPoolGetQuotaFailure(CephManagerException):
|
||||||
message = _("Error geting the OSD pool quota for %(pool)s") \
|
message = _("Error geting the OSD pool quota for "
|
||||||
+ ": %(reason)s"
|
"%(pool)s") + ": %(reason)s"
|
||||||
|
|
||||||
|
|
||||||
class CephPoolCreateFailure(CephManagerException):
|
class CephPoolCreateFailure(CephManagerException):
|
||||||
|
|
|
@ -140,9 +140,9 @@ class HandleUpgradesMixin(object):
|
||||||
# unsurpress require_jewel_osds in case upgrade
|
# unsurpress require_jewel_osds in case upgrade
|
||||||
# is aborting
|
# is aborting
|
||||||
if (state in [
|
if (state in [
|
||||||
constants.UPGRADE_ABORTING,
|
constants.UPGRADE_ABORTING,
|
||||||
constants.UPGRADE_ABORT_COMPLETING,
|
constants.UPGRADE_ABORT_COMPLETING,
|
||||||
constants.UPGRADE_ABORTING_ROLLBACK]):
|
constants.UPGRADE_ABORTING_ROLLBACK]):
|
||||||
self.wait_for_upgrade_complete = False
|
self.wait_for_upgrade_complete = False
|
||||||
return health
|
return health
|
||||||
|
|
||||||
|
|
|
@ -88,9 +88,9 @@ class BuddyInfo(object):
|
||||||
ret_string += " Zone: %s\n" % zoneinfo.get("zone")
|
ret_string += " Zone: %s\n" % zoneinfo.get("zone")
|
||||||
ret_string += " Free KiB in zone: %.2f\n" % (sum(zoneinfo.get("usage")) / (1024.0))
|
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(
|
ret_string += '\t{0:{align}{width}} {1:{align}{width}} {2:{align}{width}}\n'.format(
|
||||||
"Fragment size", "Free fragments", "Total available KiB",
|
"Fragment size", "Free fragments", "Total available KiB",
|
||||||
width=width,
|
width=width,
|
||||||
align="<")
|
align="<")
|
||||||
for idx in range(len(zoneinfo.get("sz_fragment"))):
|
for idx in range(len(zoneinfo.get("sz_fragment"))):
|
||||||
ret_string += '\t{order:{align}{width}} {nr:{align}{width}} {usage:{align}{width}}\n'.format(
|
ret_string += '\t{order:{align}{width}} {nr:{align}{width}} {usage:{align}{width}}\n'.format(
|
||||||
width=width,
|
width=width,
|
||||||
|
|
|
@ -90,9 +90,9 @@ class LogMgmtDaemon():
|
||||||
|
|
||||||
# Use python's log rotation, rather than logrotate
|
# Use python's log rotation, rather than logrotate
|
||||||
handler = logging.handlers.RotatingFileHandler(
|
handler = logging.handlers.RotatingFileHandler(
|
||||||
LOG_FILE,
|
LOG_FILE,
|
||||||
maxBytes=LOG_FILE_MAX_BYTES,
|
maxBytes=LOG_FILE_MAX_BYTES,
|
||||||
backupCount=LOG_FILE_BACKUP_COUNT)
|
backupCount=LOG_FILE_BACKUP_COUNT)
|
||||||
|
|
||||||
my_logger = logging.getLogger()
|
my_logger = logging.getLogger()
|
||||||
my_logger.setLevel(level)
|
my_logger.setLevel(level)
|
||||||
|
@ -147,10 +147,10 @@ class LogMgmtDaemon():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Ignore some files
|
# Ignore some files
|
||||||
if '/var/log/puppet' in fname \
|
if ('/var/log/puppet' in fname
|
||||||
or '/var/log/dmesg' in fname \
|
or '/var/log/dmesg' in fname
|
||||||
or '/var/log/rabbitmq' in fname \
|
or '/var/log/rabbitmq' in fname
|
||||||
or '/var/log/lastlog' in fname:
|
or '/var/log/lastlog' in fname):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if os.path.exists(fname):
|
if os.path.exists(fname):
|
||||||
|
|
|
@ -10,10 +10,9 @@ SPDX-License-Identifier: Apache-2.0
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
setuptools.setup(name='logmgmt',
|
setuptools.setup(name='logmgmt',
|
||||||
version='1.0.0',
|
version='1.0.0',
|
||||||
description='logmgmt',
|
description='logmgmt',
|
||||||
license='Apache-2.0',
|
license='Apache-2.0',
|
||||||
packages=['logmgmt'],
|
packages=['logmgmt'],
|
||||||
entry_points={
|
entry_points={}
|
||||||
}
|
)
|
||||||
)
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ def get_licenses_info():
|
||||||
features = sm_common.flex_lm_license_get_feature_list()
|
features = sm_common.flex_lm_license_get_feature_list()
|
||||||
if features.value:
|
if features.value:
|
||||||
feature_list = [feature for feature in features.value.split(',')
|
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)
|
sm_common.flex_lm_license_free(features)
|
||||||
|
|
||||||
lc_attrs_list = []
|
lc_attrs_list = []
|
||||||
|
@ -66,14 +66,14 @@ def get_licenses_info():
|
||||||
name = constants.LICENSE_MAP.get(feature)
|
name = constants.LICENSE_MAP.get(feature)
|
||||||
if process_license and name:
|
if process_license and name:
|
||||||
lc_attrs = dict(name=name, status=status,
|
lc_attrs = dict(name=name, status=status,
|
||||||
expiry_date=expiry_date)
|
expiry_date=expiry_date)
|
||||||
else:
|
else:
|
||||||
lc_attrs = dict()
|
lc_attrs = dict()
|
||||||
|
|
||||||
if lc_attrs:
|
if lc_attrs:
|
||||||
license_name = lc_attrs.get('name')
|
license_name = lc_attrs.get('name')
|
||||||
if (not any(lc.get('name') == license_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
|
# Get the list of license attributes for all valid
|
||||||
# licenses and installed expired/invalid licenses
|
# licenses and installed expired/invalid licenses
|
||||||
lc_attrs_list.append(lc_attrs)
|
lc_attrs_list.append(lc_attrs)
|
||||||
|
@ -85,8 +85,8 @@ def get_licenses_info():
|
||||||
# not-installed licenses
|
# not-installed licenses
|
||||||
for license_name in licenses:
|
for license_name in licenses:
|
||||||
lc_attrs = dict(name=license_name,
|
lc_attrs = dict(name=license_name,
|
||||||
status=constants.NOT_INSTALLED,
|
status=constants.NOT_INSTALLED,
|
||||||
expiry_date='-')
|
expiry_date='-')
|
||||||
lc_attrs_list.append(lc_attrs)
|
lc_attrs_list.append(lc_attrs)
|
||||||
|
|
||||||
# Return the list of license attributes
|
# 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
|
# Return license attributes of a valid license
|
||||||
lc_attrs = dict(name=license_name, status=constants.INSTALLED,
|
lc_attrs = dict(name=license_name, status=constants.INSTALLED,
|
||||||
expiry_date=expire_date_text.value)
|
expiry_date=expire_date_text.value)
|
||||||
|
|
||||||
return lc_attrs
|
return lc_attrs
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ def verify_license(license_file):
|
||||||
features = sm_common.flex_lm_license_get_feature_list()
|
features = sm_common.flex_lm_license_get_feature_list()
|
||||||
if features.value:
|
if features.value:
|
||||||
feature_list = [feature for feature in features.value.split(',')
|
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)
|
sm_common.flex_lm_license_free(features)
|
||||||
|
|
||||||
# Validate license of each feature in the license file
|
# 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:
|
if system_mode == sysinv_constants.SYSTEM_MODE_SIMPLEX:
|
||||||
product_license = constants.AIO_SIMPLEX_SYSTEM_LICENSES
|
product_license = constants.AIO_SIMPLEX_SYSTEM_LICENSES
|
||||||
elif (system_mode == sysinv_constants.SYSTEM_MODE_DUPLEX or
|
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
|
product_license = constants.AIO_SYSTEM_LICENSES
|
||||||
elif system_type == sysinv_constants.TIS_STD_BUILD:
|
elif system_type == sysinv_constants.TIS_STD_BUILD:
|
||||||
product_license = constants.STD_SYSTEM_LICENSES
|
product_license = constants.STD_SYSTEM_LICENSES
|
||||||
|
|
Loading…
Reference in New Issue