diff --git a/subiquity/server/controllers/network.py b/subiquity/server/controllers/network.py index 00f90094..869036d7 100644 --- a/subiquity/server/controllers/network.py +++ b/subiquity/server/controllers/network.py @@ -169,7 +169,8 @@ class NetworkController(BaseNetworkController, SubiquityController): with context.child("wait_dhcp"): try: await asyncio.wait_for( - asyncio.wait({e.wait() for e in dhcp_events}), 10 + asyncio.wait({asyncio.create_task(e.wait()) for e in dhcp_events}), + 10, ) except asyncio.TimeoutError: pass diff --git a/subiquitycore/controllers/network.py b/subiquitycore/controllers/network.py index 983606a5..b2cdbe71 100644 --- a/subiquitycore/controllers/network.py +++ b/subiquitycore/controllers/network.py @@ -391,7 +391,9 @@ class BaseNetworkController(BaseController): return try: - await asyncio.wait_for(asyncio.wait({e.wait() for e in dhcp_events}), 10) + await asyncio.wait_for( + asyncio.wait({asyncio.create_task(e.wait()) for e in dhcp_events}), 10 + ) except asyncio.TimeoutError: pass