mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge branch 'fix-diagnosis-server-bad-response' into stretch-unstable
This commit is contained in:
commit
de879e1d30
2 changed files with 8 additions and 2 deletions
|
@ -27,7 +27,10 @@ class PortsDiagnoser(Diagnoser):
|
|||
ports[port] = service
|
||||
|
||||
try:
|
||||
r = requests.post('https://diagnosis.yunohost.org/check-ports', json={'ports': ports.keys()}, timeout=30).json()
|
||||
r = requests.post('https://diagnosis.yunohost.org/check-ports', json={'ports': ports.keys()}, timeout=30)
|
||||
if r.status_code != 200:
|
||||
raise Exception("Bad response from the server https://diagnosis.yunohost.org/check-ports : %s - %s" % (str(r.status_code), r.content))
|
||||
r = r.json()
|
||||
if "status" not in r.keys():
|
||||
raise Exception("Bad syntax for response ? Raw json: %s" % str(r))
|
||||
elif r["status"] == "error":
|
||||
|
|
|
@ -28,7 +28,10 @@ class WebDiagnoser(Diagnoser):
|
|||
os.system("touch /tmp/.well-known/ynh-diagnosis/%s" % nonce)
|
||||
|
||||
try:
|
||||
r = requests.post('https://diagnosis.yunohost.org/check-http', json={'domain': domain, "nonce": nonce}, timeout=30).json()
|
||||
r = requests.post('https://diagnosis.yunohost.org/check-http', json={'domain': domain, "nonce": nonce}, timeout=30)
|
||||
if r.status_code != 200:
|
||||
raise Exception("Bad response from the server https://diagnosis.yunohost.org/check-http : %s - %s" % (str(r.status_code), r.content))
|
||||
r = r.json()
|
||||
if "status" not in r.keys():
|
||||
raise Exception("Bad syntax for response ? Raw json: %s" % str(r))
|
||||
elif r["status"] == "error" and ("code" not in r.keys() or not r["code"].startswith("error_http_check_")):
|
||||
|
|
Loading…
Add table
Reference in a new issue