feat(cred): add meta-audit command to inspect Accounts Center linked profiles and sync opm/pip accounts
This commit is contained in:
+8
-3
@@ -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)}
|
||||
|
||||
+1
-1
@@ -1976,7 +1976,7 @@ def cmd_cred_meta_audit(args):
|
||||
else:
|
||||
print("\n" + c_bold(f"=== META ACCOUNTS CENTER AUDIT: {args.node} ===") + "\n")
|
||||
if res.get("error"):
|
||||
print(c_err(f" Error: {res['error']}"))
|
||||
print(c_red(f" Error: {res['error']}"))
|
||||
sys.exit(1)
|
||||
email_str = res.get('email') or c_dim('(none / phone-only)')
|
||||
print(f" Meta Account Email: {c_cyan(email_str)}")
|
||||
|
||||
Reference in New Issue
Block a user