Skip to content

Commit

Permalink
Exposes ignore_if_missing to file.replace state module
Browse files Browse the repository at this point in the history
Fixes #36692
  • Loading branch information
lorengordon committed Sep 29, 2016
1 parent c089ac6 commit 35f3bb3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions salt/states/file.py
Expand Up @@ -2746,7 +2746,8 @@ def replace(name,
prepend_if_not_found=False,
not_found_content=None,
backup='.bak',
show_changes=True):
show_changes=True,
ignore_if_missing=False):
r'''
Maintain an edit in a file.
Expand Down Expand Up @@ -2828,6 +2829,13 @@ def replace(name,
diff. This may not normally be a concern, but could impact
performance if used with large files.
ignore_if_missing : False
.. versionadded:: 2016.3.5
Controls what to do if the file is missing. If set to ``False``, the
state will display an error raised by the execution module. If set to
``True``, the state will simply report no changes.
For complex regex patterns, it can be useful to avoid the need for complex
quoting and escape sequences by making use of YAML's multiline string
syntax.
Expand Down Expand Up @@ -2871,7 +2879,8 @@ def replace(name,
not_found_content=not_found_content,
backup=backup,
dry_run=__opts__['test'],
show_changes=show_changes)
show_changes=show_changes,
ignore_if_missing=ignore_if_missing)

if changes:
ret['pchanges']['diff'] = changes
Expand Down

0 comments on commit 35f3bb3

Please sign in to comment.