Skip to content

Instantly share code, notes, and snippets.

@bmw
Created July 29, 2021 17:51
Show Gist options
  • Save bmw/a6529e04afcd9f7aaa98748c1782be6b to your computer and use it in GitHub Desktop.
Save bmw/a6529e04afcd9f7aaa98748c1782be6b to your computer and use it in GitHub Desktop.
diff --git a/certbot/certbot/_internal/plugins/disco.py b/certbot/certbot/_internal/plugins/disco.py
index e45b0f405..c9b02efa7 100644
--- a/certbot/certbot/_internal/plugins/disco.py
+++ b/certbot/certbot/_internal/plugins/disco.py
@@ -372,31 +372,4 @@ def _implements(target_class: Type[interfaces.Plugin], iface: Type) -> bool:
def _verify(target_instance: interfaces.Plugin, target_class: Type[interfaces.Plugin],
iface: Type) -> bool:
- if issubclass(target_class, iface):
- # No need to trigger some verify logic for ABCs: when the object is instantiated,
- # an error would be raised if implementation is not done properly.
- # So the checks have been done effectively when the plugin has been initialized.
- return True
-
- zope_iface: Optional[Type[zope.interface.Interface]] = None
-
- if iface == interfaces.Plugin:
- zope_iface = interfaces.IPlugin
- if iface == interfaces.Authenticator:
- zope_iface = interfaces.IAuthenticator
- if iface == interfaces.Installer:
- zope_iface = interfaces.IInstaller
-
- if not zope_iface:
- raise ValueError(f"Unexpected type: {iface.__name__}")
-
- try:
- zope.interface.verify.verifyObject(zope_iface, target_instance)
- return True
- except zope.interface.exceptions.BrokenImplementation as error:
- if zope_iface.implementedBy(target_class):
- logger.debug(
- "%s implements %s but object does not verify: %s",
- target_class, zope_iface.__name__, error, exc_info=True)
-
- return False
+ return issubclass(target_class, iface)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment