Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.9] copy: ensure _original_basename is set #70088

Merged
merged 1 commit into from Jun 17, 2020

Conversation

Akasurde
Copy link
Member

SUMMARY
  • added changelog fragment
  • added quick and basic test
  • Revert "added quick and basic test"
  • This reverts commit 75f4141.
  • added better tests
  • now also creating files to copy on the remote
  • removed tests for recursive copying which is not supported by remote_src

Fixes: #47050

(cherry picked from commit 79dfae9)

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

changelogs/fragments/47050-copy_ensure-_original_basename-is-set.yaml
lib/ansible/modules/files/copy.py
test/integration/targets/copy/tasks/dest_in_non_existent_directories_remote_src.yml
test/integration/targets/copy/tasks/src_file_dest_file_in_non_existent_dir_remote_src.yml
test/integration/targets/copy/tasks/tests.yml

* added changelog fragment
* added quick and basic test
* Revert "added quick and basic test"
* This reverts commit 75f4141.
* added better tests
* now also creating files to copy on the remote
* removed tests for recursive copying which is not supported by remote_src

Fixes: ansible#47050

(cherry picked from commit 79dfae9)
@Akasurde
Copy link
Member Author

@abadger Could you please confirm if this PR fixes #69597? Also, could you please let me know if this PR needs to be backported for Stable-2.8?

@Akasurde Akasurde changed the title copy: ensure _original_basename is set [2.9] copy: ensure _original_basename is set Jun 16, 2020
@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 backport This PR does not target the devel branch. bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. files Files category module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jun 16, 2020
@Akasurde
Copy link
Member Author

Before -

ansible -m copy -a "src=/tmp/test.log dest=/tmp/artifacts/ remote_src=yes"  centos
127.0.0.1 | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "msg": "Destination directory /tmp/artifacts does not exist"
}

After -

ansible -m copy -a "src=/tmp/test.log dest=/tmp/artifacts/ remote_src=yes"  centos
127.0.0.1 | CHANGED => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": true,
    "checksum": "f572d396fae9206628714fb2ce00f72e94f2258f",
    "dest": "/tmp/artifacts/test.log",
    "gid": 0,
    "group": "root",
    "md5sum": "b1946ac92492d2347c6235b4d2611184",
    "mode": "0644",
    "owner": "root",
    "secontext": "unconfined_u:object_r:user_tmp_t:s0",
    "size": 6,
    "src": "/tmp/test.log",
    "state": "file",
    "uid": 0
}

@nitzmahone nitzmahone removed the needs_triage Needs a first human triage before being processed. label Jun 17, 2020
@nitzmahone nitzmahone merged commit f79c606 into ansible:stable-2.9 Jun 17, 2020
@ansible ansible locked and limited conversation to collaborators Jul 15, 2020
@Akasurde Akasurde deleted the backport/2.9/47238 branch February 8, 2021 08:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 backport This PR does not target the devel branch. bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. files Files category has_issue module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants