diff --git a/lib/ansible/modules/replace.py b/lib/ansible/modules/replace.py index 8e4b976b1ae..d09635a33b8 100644 --- a/lib/ansible/modules/replace.py +++ b/lib/ansible/modules/replace.py @@ -93,10 +93,6 @@ options: get the original file back if you somehow clobbered it incorrectly. type: bool default: no - others: - description: - - All arguments accepted by the M(ansible.builtin.file) module also work here. - type: str encoding: description: - The character encoding for reading and writing the file. @@ -246,6 +242,7 @@ def main(): path = params['path'] encoding = params['encoding'] res_args = dict(rc=0) + contents = None params['after'] = to_text(params['after'], errors='surrogate_or_strict', nonstring='passthru') params['before'] = to_text(params['before'], errors='surrogate_or_strict', nonstring='passthru') diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt index 44396362a12..dfc5dc392d6 100644 --- a/test/sanity/ignore.txt +++ b/test/sanity/ignore.txt @@ -25,8 +25,6 @@ lib/ansible/modules/git.py validate-modules:doc-required-mismatch lib/ansible/modules/lineinfile.py validate-modules:doc-choices-do-not-match-spec lib/ansible/modules/lineinfile.py validate-modules:doc-default-does-not-match-spec lib/ansible/modules/package_facts.py validate-modules:doc-choices-do-not-match-spec -lib/ansible/modules/replace.py validate-modules:nonexistent-parameter-documented -lib/ansible/modules/replace.py pylint:used-before-assignment # false positive detection by pylint lib/ansible/modules/service.py validate-modules:nonexistent-parameter-documented lib/ansible/modules/service.py validate-modules:use-run-command-not-popen lib/ansible/modules/stat.py validate-modules:parameter-invalid