Modify based on feedback

This commit is contained in:
Mandar Kulkarni 2021-08-05 16:15:45 -07:00
parent 01f599cd7a
commit d5f7cf0b22
2 changed files with 8 additions and 8 deletions

View file

@ -636,7 +636,7 @@ def main():
result = dict(changed=changed, rc=rc, cmd=cmdstr, stdout_lines=out_lines, msg=out_clean) result = dict(changed=changed, rc=rc, cmd=cmdstr, stdout_lines=out_lines, msg=out_clean)
if quiet: if quiet:
changes = len(out_lines) - 1 if len(out_lines) >= 1 else 0 changes = out.count(changed_marker) if changed else 0
result['msg'] = "%s files/directories have been synchronized" % changes result['msg'] = "%s files/directories have been synchronized" % changes
if module._diff: if module._diff:

View file

@ -229,8 +229,8 @@
- directory_b - directory_b
- name: synchronize files with quiet option - name: synchronize files with quiet option
synchronize: synchronize:
src: '{{output_dir}}/foo.txt' src: '{{ output_dir }}/foo.txt'
dest: '{{output_dir}}/foo.result' dest: '{{ output_dir }}/foo.result'
quiet: true quiet: true
register: sync_result register: sync_result
ignore_errors: true ignore_errors: true
@ -240,14 +240,14 @@
- name: Cleanup - name: Cleanup
file: file:
state: absent state: absent
path: '{{output_dir}}/{{item}}' path: '{{ output_dir }}/{{ item }}'
with_items: loop:
- foo.result - foo.result
- bar.result - bar.result
- name: synchronize files without quiet option - name: synchronize files without quiet option
synchronize: synchronize:
src: '{{output_dir}}/foo.txt' src: '{{ output_dir }}/foo.txt'
dest: '{{output_dir}}/foo.result' dest: '{{ output_dir }}/foo.result'
register: sync_result register: sync_result
ignore_errors: true ignore_errors: true
- assert: - assert:
@ -256,7 +256,7 @@
- name: Cleanup - name: Cleanup
file: file:
state: absent state: absent
path: '{{output_dir}}/{{item}}' path: '{{ output_dir }}/{{ item }}'
with_items: with_items:
- foo.result - foo.result
- bar.result - bar.result