Unbreak snap screen, and simplify it
This commit is contained in:
parent
25071d9cf0
commit
96be2a8f5d
|
@ -413,13 +413,6 @@ class SnapListView(BaseView):
|
||||||
self._w = screen
|
self._w = screen
|
||||||
|
|
||||||
def get_seed_yaml(self):
|
def get_seed_yaml(self):
|
||||||
log.debug("%r", self.controller.base_model.installpath.sources)
|
|
||||||
sources = list(self.controller.base_model.installpath.sources.values())
|
|
||||||
if len(sources) != 1 or not sources[0].startswith('cp://'):
|
|
||||||
log.warning("cannot parse install sources %r", sources)
|
|
||||||
else:
|
|
||||||
source = sources[0][5:]
|
|
||||||
log.debug("install source %r", source)
|
|
||||||
if self.controller.opts.dry_run:
|
if self.controller.opts.dry_run:
|
||||||
return '''snaps:
|
return '''snaps:
|
||||||
-
|
-
|
||||||
|
@ -431,16 +424,14 @@ class SnapListView(BaseView):
|
||||||
channel: stable/ubuntu-18.04
|
channel: stable/ubuntu-18.04
|
||||||
file: lxd_59.snap
|
file: lxd_59.snap
|
||||||
'''
|
'''
|
||||||
else:
|
seed_location = '/media/filesystem/var/lib/snapd/seed/seed.yaml'
|
||||||
seed_location = os.path.join(
|
content = ""
|
||||||
source, 'var/lib/snapd/seed/seed.yaml')
|
try:
|
||||||
try:
|
with open(seed_location, encoding='utf-8', errors='replace') as fp:
|
||||||
fp = open(seed_location, encoding='utf-8', errors='replace')
|
|
||||||
except FileNotFoundError:
|
|
||||||
log.exception("could not find source at %r", seed_location)
|
|
||||||
with fp:
|
|
||||||
content = fp.read()
|
content = fp.read()
|
||||||
return content
|
except FileNotFoundError:
|
||||||
|
log.exception("could not find source at %r", seed_location)
|
||||||
|
return content
|
||||||
|
|
||||||
def get_preinstalled_snaps(self):
|
def get_preinstalled_snaps(self):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue