Merge ~r00ta/maas:lp-2058037-3.5 into maas:3.5

Proposed by Jacopo Rota
Status: Merged
Approved by: Jacopo Rota
Approved revision: 63a95907a74e79ac7f503e479141d44897c7cd27
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~r00ta/maas:lp-2058037-3.5
Merge into: maas:3.5
Diff against target: 33 lines (+15/-7)
1 file modified
src/maasserver/workflow/bootresource.py (+15/-7)
Reviewer Review Type Date Requested Status
MAAS Lander Approve
Jacopo Rota Approve
Review via email: mp+462580@code.launchpad.net

This proposal supersedes a proposal from 2024-03-18.

Commit message

fix: lp-2058037. Ensure get-bootresourcefile-endpoints activity fails if the region is not exposing its ip yet.

(cherry-picked from 81a99768c3098a9fbd76f8de1e27ea8433af04ba)

To post a comment you must log in.
Revision history for this message
Jacopo Rota (r00ta) wrote :

self approving backport

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b lp-2058037-3.5 lp:~r00ta/maas/+git/maas into -b 3.5 lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 63a95907a74e79ac7f503e479141d44897c7cd27

review: Approve

Update scan failed

At least one of the branches involved have failed to scan. You can manually schedule a rescan if required.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/maasserver/workflow/bootresource.py b/src/maasserver/workflow/bootresource.py
index 4c76a5e..4097f7e 100644
--- a/src/maasserver/workflow/bootresource.py
+++ b/src/maasserver/workflow/bootresource.py
@@ -97,13 +97,21 @@ class BootResourcesActivity(MAASAPIClient):
97 async def get_bootresourcefile_endpoints(self) -> dict[str, list]:97 async def get_bootresourcefile_endpoints(self) -> dict[str, list]:
98 url = f"{self.url}/api/2.0/regioncontrollers/"98 url = f"{self.url}/api/2.0/regioncontrollers/"
99 regions = await self.request_async("GET", url)99 regions = await self.request_async("GET", url)
100 return {100 regions_endpoints = {}
101 r["system_id"]: [101 for region in regions:
102 compose_URL("http://:5240/MAAS/boot-resources/", src)102 # https://bugs.launchpad.net/maas/+bug/2058037
103 for src in r["ip_addresses"]103 if region["ip_addresses"]:
104 ]104 regions_endpoints[region["system_id"]] = [
105 for r in regions105 compose_URL("http://:5240/MAAS/boot-resources/", src)
106 }106 for src in region["ip_addresses"]
107 ]
108 else:
109 raise ApplicationError(
110 f"Could not retrieve the IP addresses of the region controller '{region['system_id']}' from the API. This "
111 f"activity will be retried until we have the IP for all the region controllers.",
112 non_retryable=False,
113 )
114 return regions_endpoints
107115
108 @activity.defn(name="download-bootresourcefile")116 @activity.defn(name="download-bootresourcefile")
109 async def download_bootresourcefile(117 async def download_bootresourcefile(

Subscribers

People subscribed via source and target branches