Skip to content

Commit

Permalink
Keep app.variant consistent with app.base_model.source.current.variant
Browse files Browse the repository at this point in the history
Otherwise you end up in this situation where GET /meta/client_variant
returns a different value to the variant you'd get from GET /source, and
that's just confusing. One way this confusion shows up is that if the
default source in the catalog is not server it is not selected, because
some slightly confusing client-server interactions end up setting the
entry on the source model to one of the synthesized ones.

Perhaps these don't need to be two separate attributes, but I think
system_setup depends on app.variant so leave that bit for now.
  • Loading branch information
mwhudson committed Nov 15, 2022
1 parent ed13c64 commit e19adca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions subiquity/server/controllers/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def start(self):
return
with open(path) as fp:
self.model.load_from_file(fp)
self.app.set_source_variant(self.model.current.variant)
self.app.hub.subscribe(
(InstallerChannels.CONFIGURED, 'locale'), self._set_locale)

Expand Down Expand Up @@ -138,6 +139,7 @@ async def configured(self):
else:
self.source_path = self._handler.setup()
await super().configured()
self.app.set_source_variant(self.model.current.variant)
self.app.base_model.set_source_variant(self.model.current.variant)

async def POST(self, source_id: str,
Expand Down

0 comments on commit e19adca

Please sign in to comment.