mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Yield one item per port open to be consistent with other diagnosers
This commit is contained in:
parent
91ec775ebb
commit
612a96e1e2
3 changed files with 7 additions and 8 deletions
|
@ -37,18 +37,15 @@ class PortsDiagnoser(Diagnoser):
|
|||
except Exception as e:
|
||||
raise YunohostError("diagnosis_ports_could_not_diagnose", error=e)
|
||||
|
||||
found_issues = False
|
||||
for port in ports:
|
||||
if r["ports"].get(str(port), None) is not True:
|
||||
found_issues = True
|
||||
yield dict(meta={"port": port},
|
||||
status="ERROR",
|
||||
summary=("diagnosis_ports_unreachable", {"port": port}))
|
||||
|
||||
if not found_issues:
|
||||
yield dict(meta={},
|
||||
status="SUCCESS",
|
||||
summary=("diagnosis_ports_ok", {}))
|
||||
else:
|
||||
yield dict(meta={},
|
||||
status="SUCCESS",
|
||||
summary=("diagnosis_ports_ok", {"port": port}))
|
||||
|
||||
|
||||
def main(args, env, loggers):
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
"diagnosis_description_http": "HTTP exposure",
|
||||
"diagnosis_ports_could_not_diagnose": "Could not diagnose if ports are reachable from outside. Error: {error}",
|
||||
"diagnosis_ports_unreachable": "Port {port} is not reachable from outside.",
|
||||
"diagnosis_ports_ok": "Relevant ports are reachable from outside!",
|
||||
"diagnosis_ports_ok": "Port {port} is reachable from outside.",
|
||||
"diagnosis_http_could_not_diagnose": "Could not diagnose if domain is reachable from outside. Error: {error}",
|
||||
"diagnosis_http_ok": "Domain {domain} is reachable from outside.",
|
||||
"diagnosis_http_unreachable": "Domain {domain} is unreachable through HTTP from outside.",
|
||||
|
|
|
@ -116,8 +116,10 @@ def diagnosis_run(categories=[], force=False):
|
|||
|
||||
if issues:
|
||||
if msettings.get("interface") == "api":
|
||||
# FIXME: i18n
|
||||
logger.info("You can go to the Diagnosis section (in the home screen) to see the issues found.")
|
||||
else:
|
||||
# FIXME: i18n
|
||||
logger.info("You can run 'yunohost diagnosis show --issues' to display the issues found.")
|
||||
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue