diff --git a/.coverage b/.coverage index 9a4f430844b5fa3ed744968fed3d67efa053c84f..ba766307e0278a19bffe62b2ae4dc47fc924e6c5 100644 Binary files a/.coverage and b/.coverage differ diff --git a/coverage.xml b/coverage.xml index bd61b2bc832101b8ee72e96aabaf9f1f11cecbad..017aa010d5e2ed740c2984013533687d6b421d4b 100644 --- a/coverage.xml +++ b/coverage.xml @@ -1,5 +1,5 @@ - + @@ -210,17 +210,17 @@ - - - - + + - + - - - + + + + + diff --git a/edge_cloud_management_api/controllers/edge_cloud_controller.py b/edge_cloud_management_api/controllers/edge_cloud_controller.py index d2795cf996bdc272c078eecd9b82294c2c51418b..b0951b2ebf35085e5367d798d5ed4060c46d3a03 100644 --- a/edge_cloud_management_api/controllers/edge_cloud_controller.py +++ b/edge_cloud_management_api/controllers/edge_cloud_controller.py @@ -87,13 +87,14 @@ def get_edge_cloud_zones(x_correlator: str | None = None, region=None, status=No status=status, ) - def query_region_matches(zone: str) -> bool: - """If region is None, return True (don't apply region filtering), otherwise check if the zone region matches the query region""" - return query_params.region is None or zone["edgeCloudRegion"] == query_params.region - - def query_status_matches(zone: str) -> bool: - """If status is None, return True (don't apply status filtering), otherwise check if the zone status matches the query status""" - return (query_params.status is None) or (zone["edgeCloudZoneStatus"] == query_params.status) + #def query_region_matches(zone: str) -> bool: + # return query_params.region is None or zone["edgeCloudRegion"] == query_params.region + def query_region_matches(zone: EdgeCloudZone) -> bool: + return query_params.region is None or zone.edgeCloudRegion == query_params.region + #def query_status_matches(zone: str) -> bool: + # return (query_params.status is None) or (zone["edgeCloudZoneStatus"] == query_params.status) + def query_status_matches(zone: EdgeCloudZone) -> bool: + return query_params.status is None or zone.edgeCloudZoneStatus == query_params.status response = [EdgeCloudZone(**zone).model_dump() for zone in get_all_cloud_zones()] return jsonify(response), 200