Abhijeet Kasurde 3 days ago committed by GitHub
commit 71bca70ee2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,3 @@
---
minor_changes:
- copy - fix appending symlinks information.

@ -187,7 +187,7 @@ def _walk_dirs(topdir, base_path=None, local_follow=False, trailing_slash_detect
offset += 1
if os.path.islink(topdir) and not local_follow:
r_files['symlinks'] = (os.readlink(topdir), os.path.basename(topdir))
r_files['symlinks'].append((os.readlink(topdir), os.path.basename(topdir)))
return r_files
dir_stats = os.stat(topdir)

@ -2535,3 +2535,46 @@
state: absent
loop:
- '{{ remote_file }}'
- name: Test copy with local_follow=False and dest is a symlink
block:
- name: execute - Create a test dest dir
file:
path: '{{ item }}'
state: directory
loop:
- '{{ remote_tmp_dir }}/testcase_local_follow_false_symlink_dest'
- '{{ remote_tmp_dir }}/dest'
- name: Create a dest symlink
file:
src: "{{ remote_tmp_dir }}/dest"
state: link
dest: "{{ remote_tmp_dir }}/sym_dest"
- name: Copy a file to the dest symlink
copy:
src: "{{ remote_tmp_dir }}/sym_dest"
dest: "{{ remote_tmp_dir }}/testcase_local_follow_false_symlink_dest"
local_follow: False
remote_src: True
register: copy_result
- name: Gather info about copied symlink
stat:
path: "{{ remote_tmp_dir }}/testcase_local_follow_false_symlink_dest/sym_dest"
register: stat_result
- name: Assert that the file has been copied
assert:
that:
- copy_result is changed
- stat_result.stat.exists
always:
- name: execute - Clean up
file:
path: '{{ item }}'
state: absent
loop:
- '{{ remote_tmp_dir }}/testcase_local_follow_false_symlink_dest'
- '{{ remote_tmp_dir }}/dest'

Loading…
Cancel
Save