mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 00:35:50 +02:00
Find plugins from both new and old entrypoints
This commit is contained in:
@@ -8,6 +8,9 @@ from acme import challenges
|
||||
SETUPTOOLS_PLUGINS_ENTRY_POINT = "certbot.plugins"
|
||||
"""Setuptools entry point group name for plugins."""
|
||||
|
||||
OLD_SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins"
|
||||
"""Plugins Setuptools entry point before rename."""
|
||||
|
||||
CLI_DEFAULTS = dict(
|
||||
config_files=[
|
||||
"/etc/letsencrypt/cli.ini",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""Utilities for plugins discovery and selection."""
|
||||
import collections
|
||||
import itertools
|
||||
import logging
|
||||
import pkg_resources
|
||||
|
||||
@@ -164,8 +165,12 @@ class PluginsRegistry(collections.Mapping):
|
||||
def find_all(cls):
|
||||
"""Find plugins using setuptools entry points."""
|
||||
plugins = {}
|
||||
for entry_point in pkg_resources.iter_entry_points(
|
||||
constants.SETUPTOOLS_PLUGINS_ENTRY_POINT):
|
||||
entry_points = itertools.chain(
|
||||
pkg_resources.iter_entry_points(
|
||||
constants.SETUPTOOLS_PLUGINS_ENTRY_POINT),
|
||||
pkg_resources.iter_entry_points(
|
||||
constants.OLD_SETUPTOOLS_PLUGINS_ENTRY_POINT),)
|
||||
for entry_point in entry_points:
|
||||
plugin_ep = PluginEntryPoint(entry_point)
|
||||
assert plugin_ep.name not in plugins, (
|
||||
"PREFIX_FREE_DISTRIBUTIONS messed up")
|
||||
|
||||
Reference in New Issue
Block a user