Problem
Google Cloud (and possibly other environments) will return a placeholder HTML page while your service is deploying or after it failed deploying. But this placeholder is sent with status code 200, which causes OpenAD to list the service as "Connected" while it's not.
Solution
Instead of:
if response.status_code == 200:
ret_status["message"] = "Connected"
We need to do something like:
if response.status_code == 200:
try:
if "ok" in response.json()
ret_status["message"] = "Connected"
except Exception:
ret_status["message"] = "Unavailable"
Problem
Google Cloud (and possibly other environments) will return a placeholder HTML page while your service is deploying or after it failed deploying. But this placeholder is sent with status code 200, which causes OpenAD to list the service as "Connected" while it's not.
Solution
Instead of:
We need to do something like: