Some tests build the state file in the test itself and need to
be removed. However, some tests rely on sls files inside of the
integration file state tree. Therefore, in those tests, we have
nothing to remove.
* salt/crypt.py: clean up open filehandles
* salt/fileclient.py: clean up open filehandles
* salt/grains/core.py: clean up open filehandles
* salt/modules/cp.py: clean up open filehandles
* salt/modules/data.py: clean up open filehandles
* salt/modules/dnsutil.py: clean up open filehandles
* salt/modules/dockerng.py: clean up open filehandles
* salt/modules/inspectlib/collector.py: clean up open filehandles
* salt/modules/file.py: clean up open filehandles
* salt/modules/hosts.py: clean up open filehandles
* salt/modules/incron.py: clean up open filehandles
* salt/modules/dpkg.py: clean up open filehandles
* salt/modules/linux_sysctl.py: clean up open filehandles
* salt/modules/netbsd_sysctl.py: clean up open filehandles
* salt/modules/network.py: clean up open filehandles
* salt/modules/nftables.py: clean up open filehandles
* salt/modules/openbsd_sysctl.py: clean up open filehandles
* salt/modules/rh_ip.py: clean up open filehandles
* salt/modules/portage_config.py: clean up open filehandles
* salt/modules/status.py: clean up open filehandles
* salt/modules/tls.py: clean up open filehandles
* salt/modules/xapi.py: clean up open filehandles
* salt/modules/x509.py: clean up open filehandles
* salt/modules/virt.py: clean up open filehandles
* salt/modules/zcbuildout.py: clean up open filehandles
* salt/returners/local_cache.py: clean up open filehandles
* salt/utils/cloud.py: clean up open filehandles
* salt/states/pkgrepo.py: clean up open filehandles
* salt/states/x509.py: clean up open filehandles
* salt/transport/mixins/auth.py: clean up open filehandles
* salt/utils/__init__.py: clean up open filehandles
* salt/states/pkg.py: clean up open filehandles
* salt/utils/minion.py: clean up open filehandles
* salt/utils/openstack/nova.py: clean up open filehandles
* salt/utils/openstack/swift.py: clean up open filehandles
* salt/utils/process.py: clean up open filehandles
* salt/utils/templates.py: clean up open filehandles
* salt/utils/virt.py: clean up open filehandles
* tests/integration/__init__.py: clean up open filehandles
* tests/integration/cli/grains.py: clean up open filehandles
* tests/integration/client/standard.py: clean up open filehandles
* tests/integration/modules/hosts.py: clean up open filehandles
* tests/unit/utils/vt_test.py: clean up open filehandles
* tests/integration/shell/enabled.py: clean up open filehandles
* tests/integration/states/cmd.py: clean up open filehandles
* tests/integration/states/file.py: clean up open filehandles
* tests/integration/states/match.py: clean up open filehandles
* tests/unit/config_test.py: clean up open filehandles
* tests/unit/templates/jinja_test.py: clean up open filehandles
* tests/unit/utils/find_test.py: clean up open filehandles
* tests/integration/modules/state.py: clean up open filehandles
* Update dnsutil_test to reflect changes in fopen usage
* Add integration test for #34945
* file.recurse: Do not convert octal mode string to int
When we run file.makedirs_perms to create the dest directory, we pass
through the mode to file.check_perms. However, file.check_perms expects
an octal string, not an int. This causes the initial directory to be
chmod'ed to the wrong mode. When there are files in the source
directory, file.recurse will invoke the file.directory state to manage
files/dirs in that directory, and this ends up correcting the mode as we
simply pass the dir_mode to it. However, when there are only directories
in the source directory, this never happens and the incorrect mode
remains on the destination directory.
Fixes#34945.
This test was failing when I ran it locally - I'm not sure why the
error isn't showing up in Jenkins, but I double checked the string
in the state and there should be single-quotes around the user name.
* Add git.diff function
* Fail git.latest states with uncommitted changes when force_reset=False
Also, discard these changes when running the state if force_reset=True.
* Add integration test for case where there are uncommitted changes