Only log one warning when missing dnspython

This commit is contained in:
Brad Warren 2016-08-29 16:31:58 -07:00
parent 55e86983e7
commit 456f3527cd
2 changed files with 6 additions and 6 deletions

View file

@ -217,11 +217,11 @@ s.serve_forever()" """
achall.chall, achall.domain,
achall.account_key.public_key())
except acme_errors.DependencyError:
verification_status = False
logger.warning("Dns challenge requires `dnspython`")
if not verification_status:
logger.warning("Self-verify of challenge failed.")
logger.warning("Self verification requires optional "
"dependency `dnspython` to be installed.")
else:
if not verification_status:
logger.warning("Self-verify of challenge failed.")
return response

View file

@ -90,7 +90,7 @@ class AuthenticatorTest(unittest.TestCase):
with mock.patch("certbot.plugins.manual.logger") as mock_logger:
self.auth.perform([self.dns01])
self.assertEqual(2, mock_logger.warning.call_count)
self.assertEqual(1, mock_logger.warning.call_count)
mock_raw_input.assert_called_once_with("Press ENTER to continue")