Merge pull request #42598 from rallytime/bp-42411

Back-port #42411 to 2017.7.1
This commit is contained in:
garethgreenaway 2017-07-27 17:19:12 -07:00 committed by GitHub
commit 76f1e53e10

View file

@ -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': '',