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
|
||||
try:
|
||||
diagnosis['nginx'] = check_output("nginx -t").strip().split("\n")
|
||||
except Exception as e:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
logger.warning("Unable to check 'nginx -t', exception: %s" % e)
|
||||
p = subprocess.Popen("nginx -t".split(),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
out, _ = p.communicate()
|
||||
diagnosis["nginx"] = out.strip().split("\n")
|
||||
if p.returncode != 0:
|
||||
logger.error(out)
|
||||
|
||||
# Services status
|
||||
services = service_status()
|
||||
|
|
Loading…
Add table
Reference in a new issue