chore: sync workspace — configs, docs, scripts, CI, pnpm, submodules
- Submodule pins: dbis_core, cross-chain-pmm-lps, mcp-proxmox (local, push may be pending), metamask-integration, smom-dbis-138 - Atomic swap + cross-chain-pmm-lops-publish, deploy-portal workflow, phoenix deploy-targets, routing/aggregator matrices - Docs, token-lists, forge proxy, phoenix API, runbooks, verify scripts Made-with: Cursor
This commit is contained in:
@@ -12,6 +12,21 @@ import json
|
||||
from typing import Dict, List, Optional, Any
|
||||
from proxmoxer import ProxmoxAPI
|
||||
|
||||
|
||||
def normalize_proxmox_token_name(user: str, token_name: str) -> str:
|
||||
"""Accept bare token names or full token ids in PROXMOX_TOKEN_NAME."""
|
||||
if '!' not in token_name:
|
||||
return token_name
|
||||
|
||||
token_user, bare_token_name = token_name.split('!', 1)
|
||||
if token_user != user:
|
||||
raise ValueError(
|
||||
f"PROXMOX_TOKEN_NAME is for '{token_user}', but PROXMOX_USER is '{user}'"
|
||||
)
|
||||
if not bare_token_name:
|
||||
raise ValueError("PROXMOX_TOKEN_NAME is missing the token name after '!'" )
|
||||
return bare_token_name
|
||||
|
||||
def load_env_file(env_path: str = None) -> dict:
|
||||
"""Load environment variables from .env file."""
|
||||
if env_path is None:
|
||||
@@ -76,6 +91,13 @@ def get_proxmox_connection() -> ProxmoxAPI:
|
||||
print(" PROXMOX_TOKEN_NAME=your-token-name", file=sys.stderr)
|
||||
print(" PROXMOX_TOKEN_VALUE=your-token-value", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if token_value:
|
||||
try:
|
||||
token_name = normalize_proxmox_token_name(user, token_name)
|
||||
except ValueError as exc:
|
||||
print(f"Error: {exc}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
if token_value:
|
||||
|
||||
Reference in New Issue
Block a user