Skip to content

Commit 33111e1

Browse files
committed
Added additional errors to IPlugin.prepare interface
1 parent 06a014d commit 33111e1

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

letsencrypt-nginx/letsencrypt_nginx/configurator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def get_version(self):
444444
# nginx < 0.8.48 uses machine hostname as default server_name instead of
445445
# the empty string
446446
if nginx_version < (0, 8, 48):
447-
raise errors.PluginError("Nginx version must be 0.8.48+")
447+
raise errors.NotSupportedError("Nginx version must be 0.8.48+")
448448

449449
return nginx_version
450450

letsencrypt-nginx/letsencrypt_nginx/tests/configurator_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def test_get_version(self, mock_popen):
249249
" (based on LLVM 3.5svn)",
250250
"TLS SNI support enabled",
251251
"configure arguments: --with-http_ssl_module"]))
252-
self.assertRaises(errors.PluginError, self.config.get_version)
252+
self.assertRaises(errors.NotSupportedError, self.config.get_version)
253253

254254
mock_popen.side_effect = OSError("Can't find program")
255255
self.assertRaises(errors.PluginError, self.config.get_version)

letsencrypt/interfaces.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,19 @@ class IPlugin(zope.interface.Interface):
102102
def prepare():
103103
"""Prepare the plugin.
104104
105-
Finish up any additional initialization.
106-
107-
:raises .MisconfigurationError:
108-
when full initialization cannot be completed. Plugin will
109-
be displayed on a list of available plugins.
110-
:raises .NoInstallationError:
111-
when the necessary programs/files cannot be located. Plugin
112-
will NOT be displayed on a list of available plugins.
105+
Finish up any additional initialization.
106+
107+
:raises .PluginError:
108+
when full initialization cannot be completed.
109+
:raises .MisconfigurationError:
110+
when full initialization cannot be completed. Plugin will
111+
be displayed on a list of available plugins.
112+
:raises .NoInstallationError:
113+
when the necessary programs/files cannot be located. Plugin
114+
will NOT be displayed on a list of available plugins.
115+
:raises .NotSupportedError:
116+
when the installation is recognized, but the version is not
117+
currently supported.
113118
114119
"""
115120

0 commit comments

Comments
 (0)