fix: resolve volcengine package quota parsing and status filtering

This commit is contained in:
kim
2026-06-11 13:27:06 +08:00
parent fff6397c42
commit 28c81c4816
3 changed files with 23 additions and 7 deletions
+9 -3
View File
@@ -209,15 +209,21 @@ def analyze_packages(packages):
raw_name = pkg.get("ConfigurationName", "Unknown")
raw_code = pkg.get("ConfigurationCode", "")
spec_code = pkg.get("SpecificationCode", "")
avail = pkg.get("AvailableAmount", 0)
status = pkg.get("Status", "")
if status == "Effective":
avail = pkg.get("AvailableAmount", 0)
else:
avail = 0
unit = pkg.get("Unit", "token")
target_raw = raw_code if raw_code else raw_name
norm_name = normalize_volc_name(target_raw)
print(f"📦 Pkg: Name='{raw_name}', Code='{raw_code}', Spec='{spec_code}'")
print(f"📦 Pkg: Name='{raw_name}', Code='{raw_code}', Spec='{spec_code}', Status='{status}'")
print(f" -> Target='{target_raw}' -> Norm='{norm_name}'")
print(f" -> Avail={avail} {unit}")
print(f" -> Avail={avail} {unit} (Effective: {status == 'Effective'})")
if r:
# Check Redis Key that SHOULD be set