mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] nginx diagnosis when there's an error throwing a huge useless traceback. Use Popen instead to display the real error
This commit is contained in:
parent
bf3ffc3e7d
commit
5c4bf1ed29
1 changed files with 7 additions and 6 deletions
|
@ -720,12 +720,13 @@ def tools_diagnosis(auth, private=False):
|
||||||
}
|
}
|
||||||
|
|
||||||
# nginx -t
|
# nginx -t
|
||||||
try:
|
p = subprocess.Popen("nginx -t".split(),
|
||||||
diagnosis['nginx'] = check_output("nginx -t").strip().split("\n")
|
stdout=subprocess.PIPE,
|
||||||
except Exception as e:
|
stderr=subprocess.STDOUT)
|
||||||
import traceback
|
out, _ = p.communicate()
|
||||||
traceback.print_exc()
|
diagnosis["nginx"] = out.strip().split("\n")
|
||||||
logger.warning("Unable to check 'nginx -t', exception: %s" % e)
|
if p.returncode != 0:
|
||||||
|
logger.error(out)
|
||||||
|
|
||||||
# Services status
|
# Services status
|
||||||
services = service_status()
|
services = service_status()
|
||||||
|
|
Loading…
Add table
Reference in a new issue