Merge pull request #39910 from rallytime/bp-37743

Back-port #37743 to 2016.11
This commit is contained in:
Nicole Thomas 2017-03-09 15:16:57 -07:00 committed by GitHub
commit 77ecff4e02

View file

@ -3358,7 +3358,11 @@ def replace(name,
check_res, check_msg = _check_file(name)
if not check_res:
return _error(ret, check_msg)
if ignore_if_missing and 'file not found' in check_msg:
ret['comment'] = 'No changes needed to be made'
return ret
else:
return _error(ret, check_msg)
changes = __salt__['file.replace'](name,
pattern,