()
| 1369 | |
| 1370 | |
| 1371 | def _resolve_active_cluster() -> str: |
| 1372 | env_gateway = os.environ.get("OPENSHELL_GATEWAY") |
| 1373 | if env_gateway: |
| 1374 | return env_gateway |
| 1375 | active_file = _xdg_config_home() / "openshell" / "active_gateway" |
| 1376 | try: |
| 1377 | value = active_file.read_text(encoding="utf-8").strip() |
| 1378 | except FileNotFoundError: |
| 1379 | raise SandboxError("no active gateway configured") from None |
| 1380 | if value == "": |
| 1381 | raise SandboxError("no active gateway configured") |
| 1382 | return value |
no test coverage detected