From 27d015543f56132bc547100b5b081db5a4205ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 24 Jul 2019 13:45:00 +0200 Subject: [PATCH] Remove now unused msg variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lubomír Sedlář --- pungi/compose.py | 3 +-- pungi/phases/gather/methods/method_deps.py | 5 +++-- pungi/phases/init.py | 11 +++++------ pungi/phases/pkgset/sources/source_koji.py | 3 +-- pungi/phases/pkgset/sources/source_repos.py | 8 ++++---- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/pungi/compose.py b/pungi/compose.py index 4bb77037..295f4329 100644 --- a/pungi/compose.py +++ b/pungi/compose.py @@ -219,7 +219,6 @@ class Compose(kobo.log.LoggingBase): def read_variants(self): # TODO: move to phases/init ? variants_file = self.paths.work.variants_file(arch="global") - msg = "Writing variants file: %s" % variants_file scm_dict = self.conf["variants_file"] if isinstance(scm_dict, dict): @@ -232,7 +231,7 @@ class Compose(kobo.log.LoggingBase): file_name = os.path.basename(scm_dict) scm_dict = os.path.join(self.config_dir, os.path.basename(scm_dict)) - self.log_debug(msg) + self.log_debug("Writing variants file: %s", variants_file) tmp_dir = self.mkdtemp(prefix="variants_file_") get_file_from_scm(scm_dict, tmp_dir, logger=self._logger) shutil.copy2(os.path.join(tmp_dir, file_name), variants_file) diff --git a/pungi/phases/gather/methods/method_deps.py b/pungi/phases/gather/methods/method_deps.py index 618aa3b1..3efd8e17 100644 --- a/pungi/phases/gather/methods/method_deps.py +++ b/pungi/phases/gather/methods/method_deps.py @@ -87,9 +87,10 @@ def write_pungi_config(compose, arch, variant, packages, groups, filter_packages """write pungi config (kickstart) for arch/variant""" pungi_wrapper = PungiWrapper() pungi_cfg = compose.paths.work.pungi_conf(variant=variant, arch=arch, source_name=source_name) - msg = "Writing pungi config (arch: %s, variant: %s): %s" % (arch, variant, pungi_cfg) - compose.log_info(msg) + compose.log_info( + "Writing pungi config (arch: %s, variant: %s): %s", arch, variant, pungi_cfg + ) repos = { "pungi-repo": compose.paths.work.arch_repo(arch=arch), diff --git a/pungi/phases/init.py b/pungi/phases/init.py index f41da5fd..3d5472fa 100644 --- a/pungi/phases/init.py +++ b/pungi/phases/init.py @@ -88,7 +88,6 @@ def _variant_worker(_, args, num): def write_global_comps(compose): comps_file_global = compose.paths.work.comps(arch="global") - msg = "Writing global comps file: %s" % comps_file_global scm_dict = compose.conf["comps_file"] if isinstance(scm_dict, dict): @@ -99,7 +98,7 @@ def write_global_comps(compose): comps_name = os.path.basename(scm_dict) scm_dict = os.path.join(compose.config_dir, scm_dict) - compose.log_debug(msg) + compose.log_debug("Writing global comps file: %s", comps_file_global) tmp_dir = compose.mkdtemp(prefix="comps_") get_file_from_scm(scm_dict, tmp_dir, logger=compose._logger) shutil.copy2(os.path.join(tmp_dir, comps_name), comps_file_global) @@ -110,9 +109,8 @@ def write_global_comps(compose): def write_arch_comps(compose, arch): comps_file_arch = compose.paths.work.comps(arch=arch) - msg = "Writing comps file for arch '%s': %s" % (arch, comps_file_arch) - compose.log_debug(msg) + compose.log_debug("Writing comps file for arch '%s': %s", arch, comps_file_arch) run(["comps_filter", "--arch=%s" % arch, "--no-cleanup", "--output=%s" % comps_file_arch, compose.paths.work.comps(arch="global")]) @@ -136,9 +134,10 @@ def get_lookaside_groups(compose, variant): def write_variant_comps(compose, arch, variant): comps_file = compose.paths.work.comps(arch=arch, variant=variant) - msg = "Writing comps file (arch: %s, variant: %s): %s" % (arch, variant, comps_file) - compose.log_debug(msg) + compose.log_debug( + "Writing comps file (arch: %s, variant: %s): %s", arch, variant, comps_file + ) cmd = [ "comps_filter", "--arch=%s" % arch, diff --git a/pungi/phases/pkgset/sources/source_koji.py b/pungi/phases/pkgset/sources/source_koji.py index 51a8f254..cca8e05e 100644 --- a/pungi/phases/pkgset/sources/source_koji.py +++ b/pungi/phases/pkgset/sources/source_koji.py @@ -709,12 +709,11 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event): def get_koji_event_info(compose, koji_wrapper): event_file = os.path.join(compose.paths.work.topdir(arch="global"), "koji-event") - msg = "Getting koji event" + compose.log_info("Getting koji event") result = get_koji_event_raw(koji_wrapper, compose.koji_event, event_file) if compose.koji_event: compose.log_info("Setting koji event to a custom value: %s" % compose.koji_event) else: - compose.log_info(msg) compose.log_info("Koji event: %s" % result["id"]) return result diff --git a/pungi/phases/pkgset/sources/source_repos.py b/pungi/phases/pkgset/sources/source_repos.py index 06014b15..fbf2a70c 100644 --- a/pungi/phases/pkgset/sources/source_repos.py +++ b/pungi/phases/pkgset/sources/source_repos.py @@ -138,10 +138,9 @@ def populate_global_pkgset(compose, file_list, path_prefix): arches = get_valid_arches(arch, is_multilib) ALL_ARCHES.update(arches) - msg = "Populating the global package set from a file list" global_pkgset_path = os.path.join(compose.paths.work.topdir(arch="global"), "packages.pickle") - compose.log_info(msg) + compose.log_info("Populating the global package set from a file list") pkgset = pungi.phases.pkgset.pkgsets.FilelistPackageSet( compose.conf["sigkeys"], logger=compose._logger, arches=ALL_ARCHES ) @@ -158,9 +157,10 @@ def write_pungi_config(compose, arch, variant, repos=None, comps_repo=None, pack """write pungi config (kickstart) for arch/variant""" pungi_wrapper = PungiWrapper() pungi_cfg = compose.paths.work.pungi_conf(variant=variant, arch=arch) - msg = "Writing pungi config (arch: %s, variant: %s): %s" % (arch, variant, pungi_cfg) - compose.log_info(msg) + compose.log_info( + "Writing pungi config (arch: %s, variant: %s): %s", arch, variant, pungi_cfg + ) packages, grps = get_packages_to_gather(compose, arch, variant) # include *all* packages providing system-release