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

Fix recursive copy #40166

Merged
merged 1 commit into from
May 16, 2018
Merged

Fix recursive copy #40166

merged 1 commit into from
May 16, 2018

Conversation

abadger
Copy link
Contributor

@abadger abadger commented May 15, 2018

SUMMARY

Fixes #34893

Several bugs present in this bug report
* Fixes relative path handling in copy so that it splits directories and
  reconstructs the correct file path
* Return failed in the proper circumstances
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

copy module

ANSIBLE VERSION
devel 2.5 2.4

@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. labels May 15, 2018
@ppiyakk2
Copy link

@abadger It works on me !! The file copied perfectly.

@ansibot
Copy link
Contributor

ansibot commented May 15, 2018

The test ansible-test sanity --test pylint [explain] failed with 1 error:

test/units/modules/files/test_copy.py:24:0: syntax-error invalid syntax (<string>, line 24)

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

test/units/modules/files/test_copy.py:24:54: SyntaxError: error (because / should always exist)

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 1 error:

test/units/modules/files/test_copy.py:24:54: SyntaxError: error (because / should always exist)

The test ansible-test sanity --test compile --python 3.5 [explain] failed with 1 error:

test/units/modules/files/test_copy.py:24:54: SyntaxError: error (because / should always exist)

The test ansible-test sanity --test compile --python 3.6 [explain] failed with 1 error:

test/units/modules/files/test_copy.py:24:54: SyntaxError: error (because / should always exist)

The test ansible-test sanity --test compile --python 3.7 [explain] failed with 1 error:

test/units/modules/files/test_copy.py:24:54: SyntaxError: error (because / should always exist)

The test ansible-test sanity --test pep8 [explain] failed with 48 errors:

test/units/modules/files/test_copy.py:23:25: E127 continuation line over-indented for visual indent
test/units/modules/files/test_copy.py:23:25: E265 block comment should start with '# '
test/units/modules/files/test_copy.py:24:30: E211 whitespace before '('
test/units/modules/files/test_copy.py:25:25: E265 block comment should start with '# '
test/units/modules/files/test_copy.py:27:25: E265 block comment should start with '# '
test/units/modules/files/test_copy.py:29:25: E265 block comment should start with '# '
test/units/modules/files/test_copy.py:31:25: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:33:25: E127 continuation line over-indented for visual indent
test/units/modules/files/test_copy.py:33:25: E265 block comment should start with '# '
test/units/modules/files/test_copy.py:34:30: E211 whitespace before '('
test/units/modules/files/test_copy.py:35:25: E265 block comment should start with '# '
test/units/modules/files/test_copy.py:37:25: E265 block comment should start with '# '
test/units/modules/files/test_copy.py:39:25: E265 block comment should start with '# '
test/units/modules/files/test_copy.py:41:25: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:42:22: E111 indentation is not a multiple of four
test/units/modules/files/test_copy.py:42:22: E113 unexpected indentation
test/units/modules/files/test_copy.py:43:22: E111 indentation is not a multiple of four
test/units/modules/files/test_copy.py:44:22: E111 indentation is not a multiple of four
test/units/modules/files/test_copy.py:45:22: E111 indentation is not a multiple of four
test/units/modules/files/test_copy.py:46:22: E111 indentation is not a multiple of four
test/units/modules/files/test_copy.py:47:22: E111 indentation is not a multiple of four
test/units/modules/files/test_copy.py:48:22: E111 indentation is not a multiple of four
test/units/modules/files/test_copy.py:50:5: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:51:5: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:52:5: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:54:5: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:55:9: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:56:9: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:56:47: W291 trailing whitespace
test/units/modules/files/test_copy.py:57:9: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:57:17: E251 unexpected spaces around keyword / parameter equals
test/units/modules/files/test_copy.py:57:19: E251 unexpected spaces around keyword / parameter equals
test/units/modules/files/test_copy.py:58:9: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:59:13: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:59:21: E251 unexpected spaces around keyword / parameter equals
test/units/modules/files/test_copy.py:59:23: E251 unexpected spaces around keyword / parameter equals
test/units/modules/files/test_copy.py:60:9: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:61:13: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:61:21: E251 unexpected spaces around keyword / parameter equals
test/units/modules/files/test_copy.py:61:23: E251 unexpected spaces around keyword / parameter equals
test/units/modules/files/test_copy.py:63:9: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:63:17: E251 unexpected spaces around keyword / parameter equals
test/units/modules/files/test_copy.py:63:19: E251 unexpected spaces around keyword / parameter equals
test/units/modules/files/test_copy.py:65:9: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:67:9: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:69:5: E122 continuation line missing indentation or outdented
test/units/modules/files/test_copy.py:69:8: W291 trailing whitespace
test/units/modules/files/test_copy.py:73:17: E901 IndentationError: unindent does not match any outer indentation level

click here for bot help

@sijis
Copy link
Contributor

sijis commented May 15, 2018

I can confirm this fixes the issue with using full paths too.

ansible 2.6.0 (copy_fix 18cce090d3) last updated 2018/05/15 11:19:41 (GMT -500)
  config file = None
  configured module search path = ['/home/saviles/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/saviles/data/git/github/ansible/lib/ansible
  executable location = /home/saviles/data/git/github/ansible/bin/ansible
  python version = 3.6.5 (default, Mar 29 2018, 18:20:46) [GCC 8.0.1 20180317 (Red Hat 8.0.1-0.19)]

Example playbook:

---
- hosts: local
  gather_facts: False
  tasks:
    - name: "Copy bug"
      copy:
        dest: "/tmp/test-copy"
        src: "/home/saviles/data/git/github/ansible/validations/files/tester"

@abadger abadger changed the title [WIP] Fix recursive copy Fix recursive copy May 15, 2018
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. labels May 15, 2018
@maxamillion maxamillion removed the needs_triage Needs a first human triage before being processed. label May 15, 2018
@ansibot ansibot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. labels May 15, 2018
@ansibot
Copy link
Contributor

ansibot commented May 15, 2018

The test ansible-test sanity --test pylint [explain] failed with 1 error:

test/units/modules/files/test_copy.py:216:0: trailing-newlines Trailing newlines

The test ansible-test sanity --test pep8 [explain] failed with 19 errors:

test/units/modules/files/test_copy.py:26:18: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:27:18: E128 continuation line under-indented for visual indent
test/units/modules/files/test_copy.py:28:21: E127 continuation line over-indented for visual indent
test/units/modules/files/test_copy.py:36:18: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:37:17: E126 continuation line over-indented for hanging indent
test/units/modules/files/test_copy.py:41:21: E127 continuation line over-indented for visual indent
test/units/modules/files/test_copy.py:48:18: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:50:21: E127 continuation line over-indented for visual indent
test/units/modules/files/test_copy.py:57:18: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:59:21: E127 continuation line over-indented for visual indent
test/units/modules/files/test_copy.py:66:18: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:68:21: E127 continuation line over-indented for visual indent
test/units/modules/files/test_copy.py:75:18: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:76:17: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:80:21: E127 continuation line over-indented for visual indent
test/units/modules/files/test_copy.py:85:17: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:92:17: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:93:16: E124 closing bracket does not match visual indentation
test/units/modules/files/test_copy.py:216:1: W391 blank line at end of file

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels May 15, 2018
Fixes several bugs exposed in ansible#34893
* Fixes relative path handling in copy so that it splits directories and
  reconstructs the correct file path
* Return failed in the proper circumstances
@maxamillion maxamillion merged commit ca4147f into ansible:devel May 16, 2018
@abadger abadger deleted the fix-recursive-copy branch May 16, 2018 17:32
abadger added a commit to abadger/ansible that referenced this pull request May 16, 2018
Fixes several bugs exposed in ansible#34893
* Fixes relative path handling in copy so that it splits directories and
  reconstructs the correct file path
* Return failed in the proper circumstances

(cherry picked from commit ca4147f)
jacum pushed a commit to jacum/ansible that referenced this pull request Jun 26, 2018
Fixes several bugs exposed in ansible#34893
* Fixes relative path handling in copy so that it splits directories and
  reconstructs the correct file path
* Return failed in the proper circumstances
nitzmahone pushed a commit that referenced this pull request Jul 3, 2018
* Fixes #34893 (#40166)

Fixes several bugs exposed in #34893
* Fixes relative path handling in copy so that it splits directories and
  reconstructs the correct file path
* Return failed in the proper circumstances

(cherry picked from commit ca4147f)

* Add changelog for recursive copy fix

(cherry picked from commit cab0f21)
ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
Fixes several bugs exposed in ansible#34893
* Fixes relative path handling in copy so that it splits directories and
  reconstructs the correct file path
* Return failed in the proper circumstances
@ansible ansible locked and limited conversation to collaborators May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

recursive copy does not copy files, only directories
5 participants