Skip to content

Commit

Permalink
Stop accessing deprecated attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <[email protected]>
  • Loading branch information
s0undt3ch authored and Megan Wilhite committed Jun 28, 2023
1 parent aacdfc9 commit f4eea34
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion changelog/64565.changed.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Stop using the deprecated `locale.getdefaultlocale()` function
Some more deprecated code fixes:

* Stop using the deprecated `locale.getdefaultlocale()` function
* Stop accessing deprecated attributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def reset_pillar(salt_call_cli):
finally:
# Refresh pillar once all tests are done.
ret = salt_call_cli.run("saltutil.refresh_pillar", wait=True)
assert ret.exitcode == 0
assert ret.json is True
assert ret.returncode == 0
assert ret.data is True


@pytest.fixture
Expand Down Expand Up @@ -77,8 +77,8 @@ def test_state_apply_aborts_on_pillar_error(
shell_result = salt_cli.run(
"state.apply", "sls-id-test", minion_tgt=salt_minion.id
)
assert shell_result.exitcode == 1
assert shell_result.json == expected_comment
assert shell_result.returncode == 1
assert shell_result.data == expected_comment


@pytest.mark.usefixtures("testfile_path", "reset_pillar")
Expand Down Expand Up @@ -117,7 +117,7 @@ def test_state_apply_continues_after_pillar_error_is_fixed(
shell_result = salt_cli.run(
"saltutil.refresh_pillar", minion_tgt=salt_minion.id
)
assert shell_result.exitcode == 0
assert shell_result.returncode == 0

# run state.apply with fixed pillar render error
with pytest.helpers.temp_file(
Expand All @@ -128,7 +128,7 @@ def test_state_apply_continues_after_pillar_error_is_fixed(
shell_result = salt_cli.run(
"state.apply", "sls-id-test", minion_tgt=salt_minion.id
)
assert shell_result.exitcode == 0
state_result = StateResult(shell_result.json)
assert shell_result.returncode == 0
state_result = StateResult(shell_result.data)
assert state_result.result is True
assert state_result.changes == {"diff": "New file", "mode": "0644"}

0 comments on commit f4eea34

Please sign in to comment.