From 5be82ae9fb843a9eaa714e296087ce139af73514 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Sun, 25 Jun 2023 21:18:04 +0200 Subject: [PATCH] Run pyupgrade --- salt/client/ssh/wrapper/__init__.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/salt/client/ssh/wrapper/__init__.py b/salt/client/ssh/wrapper/__init__.py index 99f0ad10b6d..3771f7a8b3a 100644 --- a/salt/client/ssh/wrapper/__init__.py +++ b/salt/client/ssh/wrapper/__init__.py @@ -114,7 +114,7 @@ class FunctionWrapper: cmd_prefix=None, aliases=None, minion_opts=None, - **kwargs + **kwargs, ): super().__init__() self.cmd_prefix = cmd_prefix @@ -163,14 +163,14 @@ class FunctionWrapper: cmd_prefix=cmd, aliases=self.aliases, minion_opts=self.minion_opts, - **kwargs + **kwargs, ) if self.cmd_prefix: # We're in an inner FunctionWrapper as created by the code block # above. Reconstruct the original cmd in the form 'cmd.run' and # then evaluate as normal - cmd = "{}.{}".format(self.cmd_prefix, cmd) + cmd = f"{self.cmd_prefix}.{cmd}" if cmd in self.wfuncs: return self.wfuncs[cmd] @@ -199,7 +199,7 @@ class FunctionWrapper: disable_wipe=True, fsclient=self.fsclient, minion_opts=self.minion_opts, - **self.kwargs + **self.kwargs, ) stdout, stderr, retcode = single.cmd_block() return parse_ret(stdout, stderr, retcode, result_only=True) @@ -214,15 +214,13 @@ class FunctionWrapper: # Form of salt.cmd.run in Jinja -- it's expecting a subdictionary # containing only 'cmd' module calls, in that case. We don't # support assigning directly to prefixes in this way - raise KeyError( - "Cannot assign to module key {} in the FunctionWrapper".format(cmd) - ) + raise KeyError(f"Cannot assign to module key {cmd} in the FunctionWrapper") if self.cmd_prefix: # We're in an inner FunctionWrapper as created by the first code # block in __getitem__. Reconstruct the original cmd in the form # 'cmd.run' and then evaluate as normal - cmd = "{}.{}".format(self.cmd_prefix, cmd) + cmd = f"{self.cmd_prefix}.{cmd}" if cmd in self.wfuncs: self.wfuncs[cmd] = value