diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 11a9ea292..02195645e 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -283,16 +283,14 @@ def _should_renew(config, lineage): "Return true if any of the circumstances for automatic renewal apply." if config.renew_by_default: logger.info("Auto-renewal forced with --renew-by-default...") - print("forced") return True if lineage.should_autorenew(interactive=True): logger.info("Cert is due for renewal, auto-renewing...") - print("due") return True if config.dry_run: logger.info("Cert not due for renewal, but simulating renewal for dry run") - print("dry") return True + logger.info("Cert not yet due for renewal") return False diff --git a/letsencrypt/tests/cli_test.py b/letsencrypt/tests/cli_test.py index 36d39590d..42f6c3bdd 100644 --- a/letsencrypt/tests/cli_test.py +++ b/letsencrypt/tests/cli_test.py @@ -573,13 +573,15 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods def test_certonly_renewal_triggers(self): # --dry-run should force renewal - _, get_utility = self._test_renewal_common(False, ['--dry-run'], None) + _, get_utility = self._test_renewal_common(False, ['--dry-run'], "simulating renewal") self.assertEqual(get_utility().add_message.call_count, 1) self.assertTrue('dry run' in get_utility().add_message.call_args[0][0]) - _, _ = self._test_renewal_common(False, ['--renew-by-default', '-tvv', '--debug'], "Auto-renewal forced") + _, _ = self._test_renewal_common(False, ['--renew-by-default', '-tvv', '--debug'], + "Auto-renewal forced") self.assertEqual(get_utility().add_message.call_count, 1) + @mock.patch('letsencrypt.cli.zope.component.getUtility') @mock.patch('letsencrypt.cli._treat_as_renewal') @mock.patch('letsencrypt.cli._init_le_client')