Pass on OSError if thin tarball already removed

This can happen in the test suite while running
integration.ssh.test_state.SSHStateTest.test_state_running because the
instance of salt-ssh running in the background has completed during the
second salt-ssh run, and since the contents of the thin tarball haven't
changed between runs, the checksum used to derive the path of the thin
tarball hasn't changed, so it is unlinked before the 2nd salt-ssh run in
that test completes.
This commit is contained in:
Erik Johnson 2018-01-20 20:57:05 -06:00 committed by rallytime
parent 4672baa6c8
commit a61afda100
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -157,7 +157,10 @@ def unpack_thin(thin_path):
tfile.extractall(path=OPTIONS.saltdir)
tfile.close()
os.umask(old_umask)
os.unlink(thin_path)
try:
os.unlink(thin_path)
except OSError:
pass
def need_ext():