Fix chroot tests

This commit is contained in:
Megan Wilhite 2023-04-03 09:04:06 -06:00
parent 62966ec126
commit c05d4cc882
2 changed files with 6 additions and 4 deletions

1
changelog/63920.fixed.md Normal file
View file

@ -0,0 +1 @@
Fix valuerror when trying to close fileclient. Remove usage of __del__ and close the filclient properly.

View file

@ -316,13 +316,14 @@ def sls(root, mods, saltenv="base", test=None, exclude=None, **kwargs):
# needed, as this module just delegate
opts = salt.utils.state.get_sls_opts(__opts__, **kwargs)
st_ = salt.client.ssh.state.SSHHighState(
opts, pillar, __salt__, salt.fileclient.get_file_client(__opts__)
)
if isinstance(mods, str):
mods = mods.split(",")
with salt.client.ssh.state.SSHHighState(
opts, pillar, __salt__, salt.fileclient.get_file_client(__opts__)
) as st_:
with st_:
high_data, errors = st_.render_highstate({saltenv: mods})
if exclude:
if isinstance(exclude, str):