summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/salt/files/salt-3005.1-importlib-metadata-5.patch')
-rw-r--r--app-admin/salt/files/salt-3005.1-importlib-metadata-5.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/app-admin/salt/files/salt-3005.1-importlib-metadata-5.patch b/app-admin/salt/files/salt-3005.1-importlib-metadata-5.patch
new file mode 100644
index 000000000000..e4b19d6bfd7f
--- /dev/null
+++ b/app-admin/salt/files/salt-3005.1-importlib-metadata-5.patch
@@ -0,0 +1,37 @@
+commit b676e6338a7c094cb3335d11f851ac0e12222017
+Author: MKLeb <calebb@vmware.com>
+Date: Wed Oct 5 15:49:37 2022 -0400
+
+ Allow entrypoint compatibility for importlib-metadata>=5.0.0
+
+diff --git a/salt/utils/entrypoints.py b/salt/utils/entrypoints.py
+index 3effa0b494..ac65ae2df4 100644
+--- a/salt/utils/entrypoints.py
++++ b/salt/utils/entrypoints.py
+@@ -38,13 +38,20 @@ def iter_entry_points(group, name=None):
+ entry_points_listing = []
+ entry_points = importlib_metadata.entry_points()
+
+- for entry_point_group, entry_points_list in entry_points.items():
+- if entry_point_group != group:
+- continue
+- for entry_point in entry_points_list:
+- if name is not None and entry_point.name != name:
++ # pre importlib-metadata 5.0.0
++ if hasattr(entry_points, "items"):
++ for entry_point_group, entry_points_list in entry_points.items():
++ if entry_point_group != group:
+ continue
+- entry_points_listing.append(entry_point)
++ for entry_point in entry_points_list:
++ if name is not None and entry_point.name != name:
++ continue
++ entry_points_listing.append(entry_point)
++ # starting with importlib-metadata 5.0.0
++ for entry_point in entry_points.select(group=group):
++ if name is not None and entry_point.name != name:
++ continue
++ entry_points_listing.append(entry_point)
+
+ return entry_points_listing
+