Skip to content

Instantly share code, notes, and snippets.

@bmw
Created July 29, 2021 17:41
Show Gist options
  • Save bmw/1ff59fe13a9974c59d951b8225d4223b to your computer and use it in GitHub Desktop.
Save bmw/1ff59fe13a9974c59d951b8225d4223b to your computer and use it in GitHub Desktop.
diff --git a/certbot-nginx/certbot_nginx/_internal/configurator.py b/certbot-nginx/certbot_nginx/_internal/configurator.py
index 66136ba70..ec9f9053d 100644
--- a/certbot-nginx/certbot_nginx/_internal/configurator.py
+++ b/certbot-nginx/certbot_nginx/_internal/configurator.py
@@ -16,6 +16,7 @@ from typing import Tuple
import OpenSSL
import pkg_resources
+import zope.interface
from acme import challenges
from acme import crypto_util as acme_crypto_util
@@ -43,7 +44,9 @@ NO_SSL_MODIFIER = 4
logger = logging.getLogger(__name__)
-class NginxConfigurator(common.Installer, interfaces.Authenticator):
+@zope.interface.implementer(interfaces.IAuthenticator, interfaces.IInstaller)
+@zope.interface.provider(interfaces.IPluginFactory)
+class NginxConfigurator(common.Installer):
"""Nginx configurator.
.. todo:: Add proper support for comments in the config. Currently,
diff --git a/certbot/certbot/_internal/plugins/disco.py b/certbot/certbot/_internal/plugins/disco.py
index e45b0f405..259593d25 100644
--- a/certbot/certbot/_internal/plugins/disco.py
+++ b/certbot/certbot/_internal/plugins/disco.py
@@ -343,6 +343,7 @@ def _provides(target_class: Type[interfaces.Plugin], iface: Type) -> bool:
if iface == interfaces.Plugin and interfaces.IPluginFactory.providedBy(target_class):
warnings.warn("Zope interface certbot.interfaces.IPluginFactory is deprecated, "
"use ABC certbot.interface.Plugin instead.")
+ print('IM WARNING YOU')
return True
return False
@@ -355,16 +356,19 @@ def _implements(target_class: Type[interfaces.Plugin], iface: Type) -> bool:
if iface == interfaces.Plugin and interfaces.IPlugin.implementedBy(target_class):
warnings.warn("Zope interface certbot.interfaces.IPlugin is deprecated, "
"use ABC certbot.interface.Plugin instead.", DeprecationWarning)
+ print('IM WARNING YOU')
return True
if iface == interfaces.Authenticator and interfaces.IAuthenticator.implementedBy(target_class):
warnings.warn("Zope interface certbot.interfaces.IAuthenticator is deprecated, "
"use ABC certbot.interface.Authenticator instead.", DeprecationWarning)
+ print('IM WARNING YOU')
return True
if iface == interfaces.Installer and interfaces.IInstaller.implementedBy(target_class):
warnings.warn("Zope interface certbot.interfaces.IInstaller is deprecated, "
"use ABC certbot.interface.Installer instead.", DeprecationWarning)
+ print('IM WARNING YOU')
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment