Run pypugrade against the files changed in the merge-forward

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-06-28 11:56:47 +01:00
parent c4987f83ed
commit 31475e74e8
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF
4 changed files with 19 additions and 25 deletions

View file

@ -20,10 +20,9 @@ def mm_conf(mm_script):
yield pathlib.Path(os.getenv("LocalAppData"), "Salt Project", "Salt", "conf")
subprocess.run(
["powershell", str(mm_script).replace(" ", "' '"), "-d"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
check=False,
universal_newlines=True,
text=True,
)
@ -41,10 +40,9 @@ def test_install(mm_script, mm_conf):
"""
ret = subprocess.run(
["powershell", str(mm_script).replace(" ", "' '")],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
check=False,
universal_newlines=True,
text=True,
)
assert ret.returncode == 0, ret.stderr
conf_file = mm_conf / "minion"
@ -58,10 +56,9 @@ def test_install_master(mm_script, mm_conf):
"""
ret = subprocess.run(
["powershell", str(mm_script).replace(" ", "' '"), "-m", "spongebob"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
check=False,
universal_newlines=True,
text=True,
)
assert ret.returncode == 0, ret.stderr
conf_file = mm_conf / "minion"
@ -75,10 +72,9 @@ def test_install_prefix(mm_script, mm_conf):
"""
ret = subprocess.run(
["powershell", str(mm_script).replace(" ", "' '"), "-p", "squarepants"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
check=False,
universal_newlines=True,
text=True,
)
assert ret.returncode == 0, ret.stderr
conf_file = mm_conf / "minion"
@ -92,10 +88,9 @@ def test_install_log_level(mm_script, mm_conf):
"""
ret = subprocess.run(
["powershell", str(mm_script).replace(" ", "' '"), "-l", "debug"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
check=False,
universal_newlines=True,
text=True,
)
assert ret.returncode == 0, ret.stderr
conf_file = mm_conf / "minion"
@ -109,10 +104,9 @@ def test_install_start(mm_script, mm_conf):
"""
ret = subprocess.run(
["powershell", str(mm_script).replace(" ", "' '"), "-s"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
check=False,
universal_newlines=True,
text=True,
)
assert ret.returncode == 0, ret.stderr
conf_file = mm_conf / "minion"

View file

@ -203,7 +203,7 @@ class Runner(RunnerClient):
arg = self.opts.get("fun", None)
docs = super().get_docs(arg)
for fun in sorted(docs):
display_output("{}:".format(fun), "text", self.opts)
display_output(f"{fun}:", "text", self.opts)
print(docs[fun])
# TODO: move to mixin whenever we want a salt-wheel cli
@ -313,13 +313,13 @@ class Runner(RunnerClient):
evt.fire_event(
{
"success": False,
"return": "{}".format(exc),
"return": f"{exc}",
"retcode": 254,
"fun": self.opts["fun"],
"fun_args": fun_args,
"jid": self.jid,
},
tag="salt/run/{}/ret".format(self.jid),
tag=f"salt/run/{self.jid}/ret",
)
# Attempt to grab documentation
if "fun" in low:
@ -330,7 +330,7 @@ class Runner(RunnerClient):
# If we didn't get docs returned then
# return the `not availble` message.
if not ret:
ret = "{}".format(exc)
ret = f"{exc}"
if not self.opts.get("quiet", False):
display_output(ret, "nested", self.opts)
else:

View file

@ -47,7 +47,7 @@ def test_versions_report(salt_run_cli):
ret_lines = [line.strip() for line in ret_lines]
for header in expected:
assert "{}:".format(header) in ret_lines
assert f"{header}:" in ret_lines
ret_dict = {}
expected_keys = set()

View file

@ -348,7 +348,7 @@ def test_user_present_change_gid_but_keep_group(
@pytest.mark.skip_unless_on_windows
def test_user_present_existing(states, username):
win_profile = "C:\\User\\{}".format(username)
win_profile = f"C:\\User\\{username}"
win_logonscript = "C:\\logon.vbs"
win_description = "Test User Account"
ret = states.user.present(
@ -360,7 +360,7 @@ def test_user_present_existing(states, username):
)
assert ret.result is True
win_profile = "C:\\Users\\{}".format(username)
win_profile = f"C:\\Users\\{username}"
win_description = "Temporary Account"
ret = states.user.present(
name=username,