Fix controller removal

Properly remove unsupported controllers.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
This commit is contained in:
Jean-Baptiste Lallement 2021-09-01 19:02:55 +02:00
parent 5b2e78a8a1
commit dadbb55fd2
1 changed files with 7 additions and 2 deletions

View File

@ -276,8 +276,13 @@ class SubiquityServer(Application):
self.snapd = AsyncSnapd(connection)
else:
log.info("no snapd socket found. Snap support is disabled")
self.controllers.remove("Refresh")
self.controllers.remove("SnapList")
reload_needed = False
for controller in ["Refresh", "Snaplist"]:
if controller in self.controllers.controller_names:
self.controllers.controller_names.remove(controller)
reload_needed = True
if reload_needed:
self.controllers.load_all()
self.snapd = None
self.note_data_for_apport("SnapUpdated", str(self.updated))
self.event_listeners = []