From 27c2ff6c64e0228ef66891e9618405abd1c1c200 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Wed, 8 Feb 2023 09:46:21 +0100 Subject: Ensure we print the correct branch number for tutorials (#35371) --- lib/spack/spack/cmd/tutorial.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/cmd/tutorial.py b/lib/spack/spack/cmd/tutorial.py index a0869bfdec..f37d73ab8c 100644 --- a/lib/spack/spack/cmd/tutorial.py +++ b/lib/spack/spack/cmd/tutorial.py @@ -63,7 +63,7 @@ def tutorial(parser, args): if not tty.get_yes_or_no("Are you sure you want to proceed?"): tty.die("Aborted") - rm_cmds = ["rm -f %s" % f for f in rm_configs] + rm_cmds = [f"rm -f {f}" for f in rm_configs] tty.msg("Reverting compiler and repository configuration", *rm_cmds) for path in rm_configs: if os.path.exists(path): @@ -71,19 +71,19 @@ def tutorial(parser, args): tty.msg( "Ensuring that the tutorial binary mirror is configured:", - "spack mirror add tutorial %s" % tutorial_mirror, + f"spack mirror add tutorial {tutorial_mirror}", ) mirror_config = syaml_dict() mirror_config["tutorial"] = tutorial_mirror spack.config.set("mirrors", mirror_config, scope="user") - tty.msg("Ensuring that we trust tutorial binaries", "spack gpg trust %s" % tutorial_key) + tty.msg("Ensuring that we trust tutorial binaries", f"spack gpg trust {tutorial_key}") spack.util.gpg.trust(tutorial_key) # Note that checkout MUST be last. It changes Spack under our feet. # If you don't put this last, you'll get import errors for the code # that follows (exacerbated by the various lazy singletons we use) - tty.msg("Ensuring we're on the releases/v{0}.{1} branch".format(*spack.spack_version_info[:2])) + tty.msg(f"Ensuring we're on the {tutorial_branch} branch") git = spack.util.git.git(required=True) with working_dir(spack.paths.prefix): git("checkout", tutorial_branch) -- cgit v1.2.3-60-g2f50