diagnostics: Use new component based API for all diagnostic tests

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-12-30 11:37:46 -05:00
1 parent 1f14c42af5
commit 2ebb565c92
43 files changed
+334 -616

No files matched your search

+11 -11
View File
@@ -85,6 +85,17 @@ class LetsEncryptApp(app_module.App):
parent_url_name='system')
self.add(menu_item)
def diagnose(self):
"""Run diagnostics and return the results."""
results = super().diagnose()
for domain in names.components.DomainName.list():
if domain.domain_type.can_have_certificate:
results.append(
action_utils.diagnose_url('https://' + domain.name))
return results
def init():
"""Initialize the module."""
@@ -106,17 +117,6 @@ def setup(helper, old_version=None):
['setup', '--old-version', str(old_version)])
def diagnose():
"""Run diagnostics and return the results."""
results = []
for domain in names.components.DomainName.list():
if domain.domain_type.can_have_certificate:
results.append(action_utils.diagnose_url('https://' + domain.name))
return results
def certificate_obtain(domain):
"""Obtain a certificate for a domain and notify handlers."""
actions.superuser_run('letsencrypt', ['obtain', '--domain', domain])