Skip to content
Snippets Groups Projects
Commit 200f5228 authored by George Papathanail's avatar George Papathanail
Browse files

change edge_cloud_zones

parent 14a961a9
No related branches found
No related tags found
Loading
Pipeline #15089 passed
No preview for this file type
<?xml version="1.0" ?>
<coverage version="7.9.1" timestamp="1751027168921" lines-valid="609" lines-covered="130" line-rate="0.2135" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
<coverage version="7.9.1" timestamp="1751027832353" lines-valid="609" lines-covered="130" line-rate="0.2135" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.9.1 -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
......@@ -210,17 +210,17 @@
<line number="69" hits="1"/>
<line number="83" hits="1"/>
<line number="84" hits="1"/>
<line number="90" hits="1"/>
<line number="92" hits="0"/>
<line number="94" hits="1"/>
<line number="96" hits="0"/>
<line number="93" hits="1"/>
<line number="94" hits="0"/>
<line number="98" hits="1"/>
<line number="99" hits="1"/>
<line number="99" hits="0"/>
<line number="101" hits="1"/>
<line number="102" hits="1"/>
<line number="107" hits="0"/>
<line number="108" hits="0"/>
<line number="113" hits="0"/>
<line number="104" hits="1"/>
<line number="105" hits="1"/>
<line number="110" hits="0"/>
<line number="111" hits="0"/>
<line number="116" hits="0"/>
</lines>
</class>
<class name="federation_manager_controller.py" filename="controllers/federation_manager_controller.py" complexity="0" line-rate="0" branch-rate="0">
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment