From 054bba5228b0ef038ea92343815a54f52c2d7c41 Mon Sep 17 00:00:00 2001 From: David Rheinsberg Date: Wed, 14 Sep 2022 08:20:19 +0200 Subject: [PATCH] stages/greenboot: avoid new pylint suppressions The `consider-using-f-string` suppression is new, thus old pylint will complain about unknown directives. If we start ignoring unknown directives for this reasons, we will no longer get warned about misspelled directives. Hence, lets avoid this for now and just use an f-string. Signed-off-by: David Rheinsberg --- stages/org.osbuild.greenboot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stages/org.osbuild.greenboot b/stages/org.osbuild.greenboot index d1af0448..2aaa63b2 100755 --- a/stages/org.osbuild.greenboot +++ b/stages/org.osbuild.greenboot @@ -65,13 +65,13 @@ def main(tree, options): svcs = current.strip('\"\n').split(" ") new_svcs = [ns for ns in value if ns not in svcs] new_svcs.extend(svcs) - # pylint: disable=consider-using-f-string - sys.stdout.write('GREENBOOT_MONITOR_SERVICES="{0}"\n'.format(" ".join(new_svcs))) + svcs_str = " ".join(new_svcs) + sys.stdout.write(f"GREENBOOT_MONITOR_SERVICES=\"{svcs_str}\"\n") with open(config_file, "a", encoding="utf8") as f: for key, value in changes.items(): if key == "monitor_services": - # pylint: disable=consider-using-f-string - f.write('GREENBOOT_MONITOR_SERVICES="{0}"\n'.format(" ".join(value))) + svcs_str = " ".join(value) + f.write(f"GREENBOOT_MONITOR_SERVICES=\"{svcs_str}\"\n") return 0