From 1640f047637ea6ebfad35c99836da47ce968698b Mon Sep 17 00:00:00 2001 From: OrangeDog <675056+OrangeDog@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:22:59 +0100 Subject: [PATCH] pre-commit augeas.py --- salt/states/augeas.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/salt/states/augeas.py b/salt/states/augeas.py index 6912223d938..4ef7725ba59 100644 --- a/salt/states/augeas.py +++ b/salt/states/augeas.py @@ -54,7 +54,7 @@ def _check_filepath(changes): cmd, arg = change_.split(" ", 1) if cmd not in METHOD_MAP: - error = "Command {} is not supported (yet)".format(cmd) + error = f"Command {cmd} is not supported (yet)" raise ValueError(error) method = METHOD_MAP[cmd] parts = salt.utils.args.shlex_split(arg) @@ -260,7 +260,7 @@ def change(name, context=None, changes=None, lens=None, load_path=None, **kwargs try: filename = _check_filepath(changes) except ValueError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret else: filename = re.sub("^/files|/$", "", context) @@ -269,7 +269,7 @@ def change(name, context=None, changes=None, lens=None, load_path=None, **kwargs ret["result"] = True ret["comment"] = "Executing commands" if context: - ret["comment"] += ' in file "{}":\n'.format(context) + ret["comment"] += f' in file "{context}":\n' ret["comment"] += "\n".join(changes) return ret