From 9e570ca05e9c4024ad52fe495d8b3cadc1fd4e6b Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Tue, 5 Dec 2023 21:40:25 -0600 Subject: [PATCH] going to slowly chip away at sanity tests Signed-off-by: Adam Miller --- plugins/modules/synchronize.py | 16 +++++----------- tests/sanity/ignore-2.14.txt | 5 ----- tests/sanity/ignore-2.15.txt | 5 ----- tests/sanity/ignore-2.16.txt | 5 ----- tests/sanity/ignore-2.17.txt | 5 ----- tests/sanity/ignore-2.9.txt | 7 ------- 6 files changed, 5 insertions(+), 38 deletions(-) diff --git a/plugins/modules/synchronize.py b/plugins/modules/synchronize.py index 4284779..315b3b8 100644 --- a/plugins/modules/synchronize.py +++ b/plugins/modules/synchronize.py @@ -171,7 +171,7 @@ options: - Add a destination to hard link against during the rsync. type: list default: - elements: str + elements: path delay_updates: description: - This option puts the temporary file from each updated file into a holding directory until the end of the transfer, @@ -388,8 +388,8 @@ def is_rsh_needed(source, dest): def main(): module = AnsibleModule( argument_spec=dict( - src=dict(type='str', required=True), - dest=dict(type='str', required=True), + src=dict(type='path', required=True), + dest=dict(type='path', required=True), dest_port=dict(type='int'), delete=dict(type='bool', default=False), private_key=dict(type='path'), @@ -418,7 +418,7 @@ def main(): verify_host=dict(type='bool', default=False), delay_updates=dict(type='bool', default=True), mode=dict(type='str', default='push', choices=['pull', 'push']), - link_dest=dict(type='list', elements='str'), + link_dest=dict(type='list', elements='path'), ), supports_check_mode=True, ) @@ -572,7 +572,7 @@ def main(): # hardlink is actually a change cmd.append('-vv') for x in link_dest: - link_path = os.path.abspath(os.path.expanduser(x)) + link_path = os.path.abspath(x) destination_path = os.path.abspath(os.path.dirname(dest)) if destination_path.find(link_path) == 0: module.fail_json(msg='Hardlinking into a subdirectory of the source would cause recursion. %s and %s' % (destination_path, dest)) @@ -581,12 +581,6 @@ def main(): changed_marker = '<>' cmd.append('--out-format=%s' % shlex_quote(changed_marker + '%i %n%L')) - # expand the paths - if '@' not in source: - source = os.path.expanduser(source) - if '@' not in dest: - dest = os.path.expanduser(dest) - cmd.append(shlex_quote(source)) cmd.append(shlex_quote(dest)) cmdstr = ' '.join(cmd) diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 3ae26db..caf2217 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,7 +1,2 @@ -plugins/modules/synchronize.py use-argspec-type-path -plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec -plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented -plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc -plugins/modules/synchronize.py validate-modules:undocumented-parameter tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/timing.py shebang diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 3ae26db..caf2217 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -1,7 +1,2 @@ -plugins/modules/synchronize.py use-argspec-type-path -plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec -plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented -plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc -plugins/modules/synchronize.py validate-modules:undocumented-parameter tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/timing.py shebang diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index d9e7dd7..3cf68c0 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -1,6 +1 @@ -plugins/modules/synchronize.py use-argspec-type-path -plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec -plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented -plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc -plugins/modules/synchronize.py validate-modules:undocumented-parameter tests/utils/shippable/timing.py shebang diff --git a/tests/sanity/ignore-2.17.txt b/tests/sanity/ignore-2.17.txt index d9e7dd7..3cf68c0 100644 --- a/tests/sanity/ignore-2.17.txt +++ b/tests/sanity/ignore-2.17.txt @@ -1,6 +1 @@ -plugins/modules/synchronize.py use-argspec-type-path -plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec -plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented -plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc -plugins/modules/synchronize.py validate-modules:undocumented-parameter tests/utils/shippable/timing.py shebang diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index b4c9d66..caf2217 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -1,9 +1,2 @@ -plugins/modules/synchronize.py pylint:disallowed-name -plugins/modules/synchronize.py pylint:blacklisted-name -plugins/modules/synchronize.py use-argspec-type-path -plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec -plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented -plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc -plugins/modules/synchronize.py validate-modules:undocumented-parameter tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/timing.py shebang