nOidZddlmZddlZddlZddlmZd dZd dZ e dk(r$ddl Z e e je d yy) z3HTTP reachability checks for critical web services.) annotationsN)Anyc tjj|d}tjj|d5}|j}ddddk}|rd |d Sd |d S#1swYxYw#tj j $r}|j}Yd}~Kd}~wt$r}dt|dcYd}~Sd}~wwxYw) z?Returns ok if the URL responds with any 2xx or 3xx status code.GET)method)timeoutN unreachable)statuserroriokdegraded)r http_code) urllibrequestRequesturlopenr r HTTPErrorcode Exceptionstr)urlreqrespr eexcr s 5/mnt/ssd/adrian/flotta-diagnostics/services_health.py _http_checkr s<nn$$S$7 ^^ # #C # 3 !t[[F ! #B dv FFjv FF ! ! << ! ! <'#c(;;r4sJ9" G   z *$**')! 45r$