fix: resolve volcengine package quota parsing and status filtering
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user