Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back-port #42411 to 2017.7.1 #42598

Merged
merged 1 commit into from Jul 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions salt/states/file.py
Expand Up @@ -2430,12 +2430,16 @@ def managed(name,
if sfn and os.path.isfile(sfn):
os.remove(sfn)
return ret

if sfn and os.path.isfile(sfn):
os.remove(sfn)

# Since we generated a new tempfile and we are not returning here
# lets change the original sfn to the new tempfile or else we will
# get file not found
if sfn and os.path.isfile(sfn):
os.remove(sfn)
sfn = tmp_filename

sfn = tmp_filename

else:
ret = {'changes': {},
'comment': '',
Expand Down