From c9f90dffb3132ff8275db4c92a3a46c95db377bb Mon Sep 17 00:00:00 2001 From: Carlos Nihelton Date: Tue, 22 Mar 2022 18:04:37 -0300 Subject: [PATCH] Fix stylistic flake8 warnings. --- system_setup/server/controllers/configure.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/system_setup/server/controllers/configure.py b/system_setup/server/controllers/configure.py index ee9d824e..f0d3e15e 100644 --- a/system_setup/server/controllers/configure.py +++ b/system_setup/server/controllers/configure.py @@ -179,13 +179,12 @@ class ConfigureController(SubiquityController): log.error('Failed to detect recommended language packs.') return False - cp = await arun_command([aptCommand,"update"], env=env) + cp = await arun_command([aptCommand, "update"], env=env) if cp.returncode != 0: # TODO: deal with the error case. log.error("Failed to update apt cache.\n%s", cp.stderr) - if self.app.opts.dry_run: # only empty in dry-run on failure. if len(packages) == 0: log.error("Packages list in dry-run should never be empty.") @@ -197,7 +196,7 @@ class ConfigureController(SubiquityController): try: for package in packages: # Just write the package uri to a file. - lcp = await arun_command([aptCommand,"install",package, + lcp = await arun_command([aptCommand, "install", package, "--simulate"], env=env) archive = os.path.join(packs_dir, package) with open(archive, "wt") as f: @@ -213,11 +212,10 @@ class ConfigureController(SubiquityController): log.info("No missing recommended packages. Nothing to do.") return True - cmd = [aptCommand,"install","-y"] + packages + cmd = [aptCommand, "install", "-y"] + packages acp = await arun_command(cmd, env=env) - return acp.returncode==0 - + return acp.returncode == 0 def _update_locale_gen_file(self, localeGenPath, lang) -> bool: """ Uncomment the line in locale.gen file matching lang, @@ -389,8 +387,8 @@ class ConfigureController(SubiquityController): envcp = os.environ.copy() # Ensures a safe escape out of the snap environment for WSL. if not self.app.opts.dry_run: - envcp['LD_LIBRARY_PATH']='' - envcp['LD_PRELOAD']='' + envcp['LD_LIBRARY_PATH'] = '' + envcp['LD_PRELOAD'] = '' await self.create_user(root_dir, envcp) await self.apply_locale(lang, envcp)