fix: IndexError parents[4] on HF container path depth
Browse files
backend/services/resource_rotation_bridge.py
CHANGED
|
@@ -39,10 +39,11 @@ def _unified_json_path() -> Path:
|
|
| 39 |
candidates = [
|
| 40 |
_workspace_root() / UNIFIED_JSON_NAME,
|
| 41 |
_workspace_root() / "api-resources" / UNIFIED_JSON_NAME,
|
| 42 |
-
here.parents[4] / ".tmp-ds-v2" / UNIFIED_JSON_NAME,
|
| 43 |
Path.cwd() / UNIFIED_JSON_NAME,
|
| 44 |
Path.cwd() / ".tmp-ds-v2" / UNIFIED_JSON_NAME,
|
| 45 |
]
|
|
|
|
|
|
|
| 46 |
for candidate in candidates:
|
| 47 |
if candidate.exists():
|
| 48 |
return candidate
|
|
|
|
| 39 |
candidates = [
|
| 40 |
_workspace_root() / UNIFIED_JSON_NAME,
|
| 41 |
_workspace_root() / "api-resources" / UNIFIED_JSON_NAME,
|
|
|
|
| 42 |
Path.cwd() / UNIFIED_JSON_NAME,
|
| 43 |
Path.cwd() / ".tmp-ds-v2" / UNIFIED_JSON_NAME,
|
| 44 |
]
|
| 45 |
+
if len(here.parents) > 4:
|
| 46 |
+
candidates.append(here.parents[4] / ".tmp-ds-v2" / UNIFIED_JSON_NAME)
|
| 47 |
for candidate in candidates:
|
| 48 |
if candidate.exists():
|
| 49 |
return candidate
|