Merge pull request #1575 from letsencrypt/misconfigured

Misconfigured selection was misconfigured (fixes #990)
This commit is contained in:
Peter Eckersley
2015-11-20 11:51:23 -08:00
2 changed files with 14 additions and 4 deletions
+9 -1
View File
@@ -34,7 +34,15 @@ def choose_plugin(prepared, question):
question, opts, help_label="More Info")
if code == display_util.OK:
return prepared[index]
plugin_ep = prepared[index]
if plugin_ep.misconfigured:
util(interfaces.IDisplay).notification(
"The selected plugin encountered an error while parsing "
"your server configuration and cannot be used. The error "
"was:\n\n{0}".format(plugin_ep.prepare()),
height=display_util.HEIGHT, pause=False)
else:
return plugin_ep
elif code == display_util.HELP:
if prepared[index].misconfigured:
msg = "Reported Error: %s" % prepared[index].prepare()
+5 -3
View File
@@ -41,9 +41,11 @@ class ChoosePluginTest(unittest.TestCase):
return choose_plugin(self.plugins, "Question?")
@mock.patch("letsencrypt.display.ops.util")
def test_successful_choice(self, mock_util):
mock_util().menu.return_value = (display_util.OK, 0)
self.assertEqual(self.mock_apache, self._call())
def test_selection(self, mock_util):
mock_util().menu.side_effect = [(display_util.OK, 0),
(display_util.OK, 1)]
self.assertEqual(self.mock_stand, self._call())
self.assertEqual(mock_util().notification.call_count, 1)
@mock.patch("letsencrypt.display.ops.util")
def test_more_info(self, mock_util):