mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] do not uses tabulate, the api needs json
This commit is contained in:
parent
bd41f0d4a2
commit
248508dcaa
1 changed files with 7 additions and 20 deletions
|
@ -90,32 +90,19 @@ def certificate_status(auth, domain_list, full=False):
|
||||||
if domain not in yunohost_domains_list:
|
if domain not in yunohost_domains_list:
|
||||||
raise MoulinetteError(errno.EINVAL, m18n.n('certmanager_domain_unknown', domain=domain))
|
raise MoulinetteError(errno.EINVAL, m18n.n('certmanager_domain_unknown', domain=domain))
|
||||||
|
|
||||||
# Get status for each domain, and prepare display using tabulate
|
|
||||||
if not full:
|
|
||||||
headers = ["Domain", "Certificate status", "Authority type", "Days remaining"]
|
|
||||||
else:
|
|
||||||
headers = ["Domain", "Certificate subject", "Certificate status", "Authority type", "Authority name", "Days remaining"]
|
|
||||||
|
|
||||||
lines = []
|
lines = []
|
||||||
|
|
||||||
for domain in domain_list:
|
for domain in domain_list:
|
||||||
status = _get_status(domain)
|
status = _get_status(domain)
|
||||||
|
status["summaryCode"] = _summary_code_to_string(status["summaryCode"])
|
||||||
|
|
||||||
line = []
|
if not full:
|
||||||
line.append(domain)
|
del status["subject"]
|
||||||
|
del status["CAname"]
|
||||||
|
|
||||||
if full:
|
lines.append(status)
|
||||||
line.append(status["subject"])
|
|
||||||
|
|
||||||
line.append(_summary_code_to_string(status["summaryCode"]))
|
return lines
|
||||||
line.append(status["CAtype"])
|
|
||||||
|
|
||||||
if full:
|
|
||||||
line.append(status["CAname"])
|
|
||||||
|
|
||||||
line.append(status["validity"])
|
|
||||||
lines.append(line)
|
|
||||||
|
|
||||||
print(tabulate(lines, headers=headers, tablefmt="simple", stralign="center"))
|
|
||||||
|
|
||||||
|
|
||||||
def certificate_install(auth, domain_list, force=False, no_checks=False, self_signed=False):
|
def certificate_install(auth, domain_list, force=False, no_checks=False, self_signed=False):
|
||||||
|
|
Loading…
Add table
Reference in a new issue