feat(cred): add meta-audit command to inspect Accounts Center linked profiles and sync opm/pip accounts

This commit is contained in:
operator
2026-10-04 23:03:27 +00:00
parent 75e6e745a9
commit f88e3c4f57
2 changed files with 9 additions and 4 deletions
+8 -3
View File
@@ -272,9 +272,14 @@ class CredClient:
cmd = ["sudo", "-n", "ip", "netns", "exec", f"warp-{node}", sys.executable, meta_script, "list-linked", node]
try:
res = subprocess.run(cmd, capture_output=True, text=True, timeout=15)
lines = res.stdout.strip().splitlines()
if lines:
return json.loads(lines[-1])
out = res.stdout.strip()
if out:
# Find outermost JSON object
start = out.find("{")
end = out.rfind("}")
if start >= 0 and end >= start:
return json.loads(out[start:end+1])
return json.loads(out)
return {"error": res.stderr.strip() or "No output from meta-acct.py"}
except Exception as e:
return {"error": str(e)}