Removes __recomended_language_packs() env argument
That function will not require a custom environment. Also simplified snap_dir variable assignment.
This commit is contained in:
parent
a36120e0bb
commit
a950d9e98f
|
@ -123,7 +123,7 @@ class ConfigureController(SubiquityController):
|
|||
|
||||
return True
|
||||
|
||||
async def __recommended_language_packs(self, lang, env) \
|
||||
async def __recommended_language_packs(self, lang) \
|
||||
-> Optional[List[str]]:
|
||||
""" Return a list of package names recommended by
|
||||
check-language-support (or a fake list if in dryrun).
|
||||
|
@ -146,18 +146,14 @@ class ConfigureController(SubiquityController):
|
|||
clsLang = langCodes[0]
|
||||
packages = []
|
||||
# Running that command doesn't require root.
|
||||
snap_dir = os.getenv("SNAP")
|
||||
if snap_dir is None:
|
||||
snap_dir = "/"
|
||||
|
||||
snap_dir = os.getenv("SNAP", default="/")
|
||||
data_dir = os.path.join(snap_dir, "usr/share/language-selector")
|
||||
if not os.path.exists(data_dir):
|
||||
log.error("Misconfigured snap environment pointed L-S-C data dir"
|
||||
" to %s", data_dir)
|
||||
return None
|
||||
|
||||
cp = await arun_command([clsCommand, "-d", data_dir, "-l", clsLang],
|
||||
env=env)
|
||||
cp = await arun_command([clsCommand, "-d", data_dir, "-l", clsLang])
|
||||
if cp.returncode != 0:
|
||||
log.error('Command "%s" failed with return code %d',
|
||||
cp.args, cp.returncode)
|
||||
|
|
Loading…
Reference in New Issue