Fix file.managed check_cmd file not found - Issue #42404

This commit is contained in:
Richard Clark 2017-07-19 20:30:49 -07:00 committed by rallytime
parent 5c7def9a43
commit 190cdb8693

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