mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
Properly handle None value for installer in updater
This commit is contained in:
parent
43f2bfd6f1
commit
50cb6975bc
2 changed files with 12 additions and 0 deletions
|
|
@ -263,6 +263,10 @@ def cli_plugin_requests(config): # pylint: disable=too-many-branches
|
|||
:rtype: tuple
|
||||
"""
|
||||
req_inst = req_auth = config.configurator
|
||||
if config.installer == 'None':
|
||||
config.installer = None
|
||||
if config.authenticator == 'None':
|
||||
config.authenticator = None
|
||||
req_inst = set_configurator(req_inst, config.installer)
|
||||
req_auth = set_configurator(req_auth, config.authenticator)
|
||||
|
||||
|
|
|
|||
|
|
@ -215,6 +215,14 @@ class GetUnpreparedInstallerTest(test_util.ConfigTestCase):
|
|||
self.mock_apache_fail_ep.name = "apache"
|
||||
self.assertRaises(errors.PluginSelectionError, self._call)
|
||||
|
||||
def test_return_early_if_none(self):
|
||||
self.config.installer = 'None'
|
||||
# Make sure that the function returns early. PluginsRegistry.filter is
|
||||
# called right after we should return.
|
||||
with mock.patch('certbot.plugins.disco.PluginsRegistry.filter') as mock_f:
|
||||
self._call()
|
||||
self.assertFalse(mock_f.called)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main() # pragma: no cover
|
||||
|
|
|
|||
Loading…
Reference in a new issue