From 82ebddca006d1dc61855fdd34b0616222039ea58 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 14 Jul 2020 01:02:00 +0800 Subject: [PATCH] Fix compatibility issue in 5.3 The offending entry point object looks like: EntryPoint(name='compute', value='openstackclient.compute.client', group='openstack.cli.base') Story: 2007917 Task: 40323 Change-Id: I0f3cc62e23efdc14203ce6645581d5ba5dbf7fa0 --- openstackclient/common/clientmanager.py | 5 ++++- releasenotes/notes/entrypoint-3.8-0597d159889042f7.yaml | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/entrypoint-3.8-0597d159889042f7.yaml diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py index 66dc880e0..36c3ce268 100644 --- a/openstackclient/common/clientmanager.py +++ b/openstackclient/common/clientmanager.py @@ -154,7 +154,10 @@ def get_plugin_modules(group): try: module_name = ep.entry_point.module_name except AttributeError: - module_name = ep.entry_point.module + try: + module_name = ep.entry_point.module + except AttributeError: + module_name = ep.entry_point.value try: module = importlib.import_module(module_name) diff --git a/releasenotes/notes/entrypoint-3.8-0597d159889042f7.yaml b/releasenotes/notes/entrypoint-3.8-0597d159889042f7.yaml new file mode 100644 index 000000000..cb25cff14 --- /dev/null +++ b/releasenotes/notes/entrypoint-3.8-0597d159889042f7.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue with python 3.8 and entrypoint loading where the + new builtin importlib entrypoint support had a different + attribute api than expected.