drivers: do not consider overlay cleanup error fatal
For some reason that we have not yet determined, the overlay that we use for the drivers code sometimes fails to unmount with EBUSY. When it happens, the _list_drivers task would fail, making subsequent GET calls to /drivers?wait=true fail as well and produce an error report. We now mark failures in the overlay unmount operation as non fatal. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
parent
aae52dd6ba
commit
6954b309e6
|
@ -21,6 +21,7 @@ from subiquitycore.context import with_context
|
||||||
|
|
||||||
from subiquity.common.apidef import API
|
from subiquity.common.apidef import API
|
||||||
from subiquity.common.types import DriversPayload, DriversResponse
|
from subiquity.common.types import DriversPayload, DriversResponse
|
||||||
|
from subiquity.server.apt import OverlayCleanupError
|
||||||
from subiquity.server.controller import SubiquityController
|
from subiquity.server.controller import SubiquityController
|
||||||
from subiquity.server.types import InstallerChannels
|
from subiquity.server.types import InstallerChannels
|
||||||
from subiquity.server.ubuntu_drivers import (
|
from subiquity.server.ubuntu_drivers import (
|
||||||
|
@ -83,16 +84,19 @@ class DriversController(SubiquityController):
|
||||||
await self.configured()
|
await self.configured()
|
||||||
return
|
return
|
||||||
apt = self.app.controllers.Mirror.apt_configurer
|
apt = self.app.controllers.Mirror.apt_configurer
|
||||||
async with apt.overlay() as d:
|
try:
|
||||||
try:
|
async with apt.overlay() as d:
|
||||||
# Make sure ubuntu-drivers is available.
|
try:
|
||||||
await self.ubuntu_drivers.ensure_cmd_exists(d.mountpoint)
|
# Make sure ubuntu-drivers is available.
|
||||||
except CommandNotFoundError:
|
await self.ubuntu_drivers.ensure_cmd_exists(d.mountpoint)
|
||||||
self.drivers = []
|
except CommandNotFoundError:
|
||||||
else:
|
self.drivers = []
|
||||||
self.drivers = await self.ubuntu_drivers.list_drivers(
|
else:
|
||||||
root_dir=d.mountpoint,
|
self.drivers = await self.ubuntu_drivers.list_drivers(
|
||||||
context=context)
|
root_dir=d.mountpoint,
|
||||||
|
context=context)
|
||||||
|
except OverlayCleanupError:
|
||||||
|
log.exception("Failed to cleanup overlay. Continuing anyway.")
|
||||||
log.debug("Available drivers to install: %s", self.drivers)
|
log.debug("Available drivers to install: %s", self.drivers)
|
||||||
if not self.drivers:
|
if not self.drivers:
|
||||||
await self.configured()
|
await self.configured()
|
||||||
|
|
Loading…
Reference in New Issue