Merge pull request #750 from mwhudson/autoinstall-no-net
fix autoinstall crash with no network
This commit is contained in:
commit
449f459ecb
|
@ -78,7 +78,10 @@ class MirrorController(SubiquityController):
|
|||
async def apply_autoinstall_config(self, context):
|
||||
if not self.geoip_enabled:
|
||||
return
|
||||
if self.lookup_task.task is None:
|
||||
return
|
||||
try:
|
||||
with context.child('waiting'):
|
||||
await asyncio.wait_for(self.lookup_task.wait(), 10)
|
||||
except asyncio.TimeoutError:
|
||||
pass
|
||||
|
@ -90,8 +93,8 @@ class MirrorController(SubiquityController):
|
|||
self.check_state = CheckState.CHECKING
|
||||
self.lookup_task.start_sync()
|
||||
|
||||
async def lookup(self):
|
||||
with self.context.child("lookup"):
|
||||
@with_context()
|
||||
async def lookup(self, context):
|
||||
try:
|
||||
response = await run_in_thread(
|
||||
requests.get, "https://geoip.ubuntu.com/lookup")
|
||||
|
|
Loading…
Reference in New Issue