File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
tests/model_explainability/guardrails Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -387,8 +387,12 @@ def guardrails_orchestrator_ssl_cert(guardrails_orchestrator_route: Route):
387387 input = "" ,
388388 capture_output = True ,
389389 text = True ,
390+ timeout = 30 ,
390391 )
391392
393+ if result .returncode != 0 and "CONNECTED" not in result .stdout :
394+ raise RuntimeError (f"Failed to connect to { hostname } : { result .stderr } " )
395+
392396 cert_lines = []
393397 in_cert = False
394398 for line in result .stdout .splitlines ():
@@ -399,6 +403,9 @@ def guardrails_orchestrator_ssl_cert(guardrails_orchestrator_route: Route):
399403 if "-----END CERTIFICATE-----" in line :
400404 in_cert = False
401405
406+ if not cert_lines :
407+ raise RuntimeError (f"No certificate found in response from { hostname } " )
408+
402409 filepath = os .path .join (py_config ["tmp_base_dir" ], "gorch_cert.crt" )
403410 with open (filepath , "w" ) as f :
404411 f .write ("\n " .join (cert_lines ))
You can’t perform that action at this time.
0 commit comments