diff --git a/subiquity/server/controllers/network.py b/subiquity/server/controllers/network.py index 00f90094b..869036d72 100644 --- a/subiquity/server/controllers/network.py +++ b/subiquity/server/controllers/network.py @@ -169,7 +169,8 @@ async def wait_for_initial_config(self, context): 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 983606a51..b2cdbe71b 100644 --- a/subiquitycore/controllers/network.py +++ b/subiquitycore/controllers/network.py @@ -391,7 +391,9 @@ def error(stage): 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