Commit 36b2c6b9 authored by Adrian Pino's avatar Adrian Pino
Browse files

Merge branch 'hotfix/remove-tmp-code-bug-gpu' into 'main'

hotfix/remove-tmp-code-bug-gpu: remove tmp code for gpu info bug

See merge request !181
parents 51117eb6 eb2f5cda
Loading
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -797,23 +797,6 @@ class EdgeApplicationManager(EdgeCloudManagementInterface):
        try:
            response = i2edge_get(url, params=params, expected_status=200)
            response_json = response.json()
            # TODO: fix malformed GPU field in i2Edge, it should be a list of objects, not strings
            # --- Quick fix for malformed GPU entries ---
            quota_limits = response_json.get("computeResourceQuotaLimits", [])
            for item in quota_limits:
                if isinstance(item, dict) and isinstance(item.get("gpu"), list):
                    fixed_gpu = []
                    for g in item["gpu"]:
                        if isinstance(g, str):
                            try:
                                # Convert single quotes to double quotes for valid JSON
                                fixed_gpu.append(json.loads(g.replace("'", '"')))
                            except json.JSONDecodeError:
                                continue  # ignore invalid entries
                        else:
                            fixed_gpu.append(g)
                    item["gpu"] = fixed_gpu
            # --- End quick fix ---
            mapped = map_zone(response_json)
            try:
                validated_data = gsma_schemas.ZoneRegisteredData.model_validate(mapped)