mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 22:33:00 -04:00
run: dont report new certs when only re-installing (#8392)
This commit is contained in:
parent
fc864543a7
commit
bf07ec20b0
2 changed files with 7 additions and 2 deletions
|
|
@ -1109,7 +1109,9 @@ def run(config, plugins):
|
|||
cert_path = new_lineage.cert_path if new_lineage else None
|
||||
fullchain_path = new_lineage.fullchain_path if new_lineage else None
|
||||
key_path = new_lineage.key_path if new_lineage else None
|
||||
_report_new_cert(config, cert_path, fullchain_path, key_path)
|
||||
|
||||
if should_get_cert:
|
||||
_report_new_cert(config, cert_path, fullchain_path, key_path)
|
||||
|
||||
_install_cert(config, le_client, domains, new_lineage)
|
||||
|
||||
|
|
|
|||
|
|
@ -1281,13 +1281,16 @@ class MainTest(test_util.ConfigTestCase):
|
|||
@test_util.patch_get_utility()
|
||||
@mock.patch('certbot._internal.main._find_lineage_for_domains_and_certname')
|
||||
@mock.patch('certbot._internal.main._init_le_client')
|
||||
def test_certonly_reinstall(self, mock_init, mock_renewal, mock_get_utility):
|
||||
@mock.patch('certbot._internal.main._report_new_cert')
|
||||
def test_certonly_reinstall(self, mock_report_new_cert, mock_init,
|
||||
mock_renewal, mock_get_utility):
|
||||
mock_renewal.return_value = ('reinstall', mock.MagicMock())
|
||||
mock_init.return_value = mock_client = mock.MagicMock()
|
||||
self._call(['-d', 'foo.bar', '-a', 'standalone', 'certonly'])
|
||||
self.assertFalse(mock_client.obtain_certificate.called)
|
||||
self.assertFalse(mock_client.obtain_and_enroll_certificate.called)
|
||||
self.assertEqual(mock_get_utility().add_message.call_count, 0)
|
||||
mock_report_new_cert.assert_not_called()
|
||||
#self.assertTrue('donate' not in mock_get_utility().add_message.call_args[0][0])
|
||||
|
||||
def _test_certonly_csr_common(self, extra_args=None):
|
||||
|
|
|
|||
Loading…
Reference in a new issue