spark: add hermes diagnostic script
This commit is contained in:
1 parent
d95512c2f7
commit
3025356723
1 file changed
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Hermes environment diagnostic - verifies key paths and permissions."""
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
diag = {
|
||||
"profile": os.environ.get("SPARK_PROFILE", "spark"),
|
||||
"home": str(Path.home()),
|
||||
"cwd": str(Path.cwd()),
|
||||
"scratch": "/root/.hermes/profiles/spark/cache/scratch",
|
||||
"forge_token": ("<set>" if os.environ.get("FORGE_TOKEN") else "<unset>"),
|
||||
"checks": {}
|
||||
}
|
||||
|
||||
for name, p in [("home", Path.home()), ("scratch", Path(diag["scratch"]))]:
|
||||
diag["checks"][name] = {
|
||||
"exists": p.exists(),
|
||||
"writable": os.access(p, os.W_OK) if p.exists() else False
|
||||
}
|
||||
|
||||
print(json.dumps(diag, indent=2))
|
||||
Reference in new issue
Block a user