Merge "Enable Flake8 E12X Errors"
This commit is contained in:
commit
337298b820
@ -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):
|
||||
|
@ -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
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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):
|
||||
|
@ -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={}
|
||||
)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user