From dbc298b4ccc8f776791745496ff303387ad88f24 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 31 Oct 2024 15:48:53 +0900 Subject: [PATCH] Drop workaround for Python 3.8 ... because now it is no longer supported. Change-Id: I494e4ddb34109a4ed001a39dac55652ab82eaf5d --- heat/common/pluginutils.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/heat/common/pluginutils.py b/heat/common/pluginutils.py index 1fc9618ee6..b00786a275 100644 --- a/heat/common/pluginutils.py +++ b/heat/common/pluginutils.py @@ -18,17 +18,8 @@ LOG = logging.getLogger(__name__) def log_fail_msg(manager, entrypoint, exception): - # importlib.metadata in Python 3.8 is quite old and the EntryPoint class - # does not have module. This logic is required to workaround AttributeError - # caused by that old implementation. - if hasattr(entrypoint, 'module'): - LOG.warning('Encountered exception while loading %(module_name)s: ' - '"%(message)s". Not using %(name)s.', - {'module_name': entrypoint.module, - 'message': getattr(exception, 'message', str(exception)), - 'name': entrypoint.name}) - else: - LOG.warning('Encountered exception: "%(message)s". ' - 'Not using %(name)s.', - {'message': getattr(exception, 'message', str(exception)), - 'name': entrypoint.name}) + LOG.warning('Encountered exception while loading %(module_name)s: ' + '"%(message)s". Not using %(name)s.', + {'module_name': entrypoint.module, + 'message': getattr(exception, 'message', str(exception)), + 'name': entrypoint.name})