Merge pull request #42411 from seedickcode/check_cmd_fix

Fix file.managed check_cmd file not found - Issue #42404
This commit is contained in:
Mike Place 2017-07-20 16:59:16 -05:00 committed by GitHub
commit 33e90be1fe

View file

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