Skip to content

Commit

Permalink
Fix state.test test, run pre-commit
Browse files Browse the repository at this point in the history
The test fix was part of 6a71510
  • Loading branch information
lkubb authored and dwoz committed Jun 25, 2024
1 parent db1dfb6 commit 8e54f28
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions salt/client/ssh/wrapper/slsutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def run():
default_renderer,
__opts__["renderer_blacklist"],
__opts__["renderer_whitelist"],
**kwargs
**kwargs,
)
return ret.read() if salt.utils.stringio.is_readable(ret) else ret

Expand All @@ -185,12 +185,12 @@ def _get_serialize_fn(serializer, fn_name):

if not fns:
raise salt.exceptions.CommandExecutionError(
"Serializer '{}' not found.".format(serializer)
f"Serializer '{serializer}' not found."
)

if not fn:
raise salt.exceptions.CommandExecutionError(
"Serializer '{}' does not implement {}.".format(serializer, fn_name)
f"Serializer '{serializer}' does not implement {fn_name}."
)

return fn
Expand Down Expand Up @@ -419,7 +419,7 @@ def findup(startpath, filenames, saltenv="base"):
# Verify the cwd is a valid path in the state tree
if startpath and not path_exists(startpath, saltenv):
raise salt.exceptions.SaltInvocationError(
"Starting path not found in the state tree: {}".format(startpath)
f"Starting path not found in the state tree: {startpath}"
)

# Ensure that patterns is a string or list of strings
Expand Down
2 changes: 1 addition & 1 deletion tests/pytests/integration/ssh/state/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def state_tree(base_env_state_tree_root_dir):
state_file = """
{%- from "map.jinja" import abc with context %}
Ok with {{ abc }}:
test.succeed_without_changes
test.succeed_with_changes
"""
top_tempfile = pytest.helpers.temp_file(
"top.sls", top_file, base_env_state_tree_root_dir
Expand Down
4 changes: 3 additions & 1 deletion tests/pytests/integration/ssh/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def test_items(salt_ssh_cli):
@pytest.mark.parametrize("omit", (False, True))
def test_option_minion_opt(salt_ssh_cli, omit):
# Minion opt
ret = salt_ssh_cli.run("config.option", "id", omit_opts=omit, omit_grains=True)
ret = salt_ssh_cli.run(
"config.option", "id", omit_opts=omit, omit_grains=True, omit_master=True
)
assert ret.returncode == 0
assert (ret.data != salt_ssh_cli.get_minion_tgt()) is omit
assert (ret.data == "") is omit
Expand Down
1 change: 0 additions & 1 deletion tests/pytests/unit/client/ssh/wrapper/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
This tests the SSH wrapper module.
"""


import fnmatch

import pytest
Expand Down

0 comments on commit 8e54f28

Please sign in to comment.