Skip to content

copy action plugin diff output for multi files 2#84423

Open
simonLeary42 wants to merge 18 commits into
ansible:develfrom
simonLeary42:copy-action-diff
Open

copy action plugin diff output for multi files 2#84423
simonLeary42 wants to merge 18 commits into
ansible:develfrom
simonLeary42:copy-action-diff

Conversation

@simonLeary42

Copy link
Copy Markdown
Contributor

I accidentally broke the commit history on my previous pull request and don't know how to fix / re-open it.

#81346

@ansibot ansibot added the needs_triage Needs a first human triage before being processed. label Dec 3, 2024
@s-hertel s-hertel removed the needs_triage Needs a first human triage before being processed. label Dec 10, 2024
@s-hertel s-hertel self-requested a review December 10, 2024 15:08
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Dec 17, 2024
if "diff" in module_return:
result['diff'].append(module_return['diff'])

if module_executed and len(source_files['files']) == 1:

@simonLeary42 simonLeary42 Jun 26, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        if module_executed and len(source_files['files']) == 1 and len(source_files['directories']) == 0 and len(source_files['symlinks']) == 0:
            result.update(module_return)

            # the file module returns the file path as 'path', but
            # the copy module uses 'dest', so add it if it's not there
            if 'path' in result and 'dest' not in result:
                result['dest'] = result['path']
        else:
            result.update(dict(dest=dest, src=source, changed=changed))

        if 'diff' in result and not result['diff']:
            del result['diff']

this whole block seems fishy to me. I think it might need to be removed. Since result.changed and result.diff is handled in each iteration of each loop beforehand, I don't think this is necessary. But I didn't do the path / dest switch beforehand. Also, if it does result.update it could trash all the diffs that have been accumulated in the 3 loops.

@ansibot ansibot added the stale_pr This PR has not been pushed to for more than one year. label Nov 21, 2025
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_pr This PR has not been pushed to for more than one year.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants