From 4408b2c3e1ab421be8303c5c16cd5f8dd22ee33b Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Fri, 19 Jul 2024 07:14:23 +1200 Subject: [PATCH] replace - fix documentation and remove ignore clauses (#83574) --- lib/ansible/modules/replace.py | 5 +---- test/sanity/ignore.txt | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) 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