mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Run pypugrade
against the files changed in the merge-forward
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
c4987f83ed
commit
31475e74e8
4 changed files with 19 additions and 25 deletions
|
@ -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"
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue