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] cmd = ["sudo", "-n", "ip", "netns", "exec", f"warp-{node}", sys.executable, meta_script, "list-linked", node]
try: try:
res = subprocess.run(cmd, capture_output=True, text=True, timeout=15) res = subprocess.run(cmd, capture_output=True, text=True, timeout=15)
lines = res.stdout.strip().splitlines() out = res.stdout.strip()
if lines: if out:
return json.loads(lines[-1]) # 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"} return {"error": res.stderr.strip() or "No output from meta-acct.py"}
except Exception as e: except Exception as e:
return {"error": str(e)} return {"error": str(e)}
+1 -1
View File
@@ -1976,7 +1976,7 @@ def cmd_cred_meta_audit(args):
else: else:
print("\n" + c_bold(f"=== META ACCOUNTS CENTER AUDIT: {args.node} ===") + "\n") print("\n" + c_bold(f"=== META ACCOUNTS CENTER AUDIT: {args.node} ===") + "\n")
if res.get("error"): if res.get("error"):
print(c_err(f" Error: {res['error']}")) print(c_red(f" Error: {res['error']}"))
sys.exit(1) sys.exit(1)
email_str = res.get('email') or c_dim('(none / phone-only)') email_str = res.get('email') or c_dim('(none / phone-only)')
print(f" Meta Account Email: {c_cyan(email_str)}") print(f" Meta Account Email: {c_cyan(email_str)}")