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 for file module with symlinks to nonexistent target #39635

Merged
merged 3 commits into from
May 4, 2018

Conversation

abadger
Copy link
Contributor

@abadger abadger commented May 2, 2018

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes #39558

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/modules/files/file.py

ANSIBLE VERSION
devel 2.5.2
ADDITIONAL INFORMATION

Questions for other committers:

  • Should we warn on this case? yes.
  • Are there other cases where we'd want to override follow and work on the link instead of the link's target?

@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 2, 2018
When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes ansible#39558
@abadger abadger changed the title [WIP] Fix for file module with symlinks to nonexistent target Fix for file module with symlinks to nonexistent target May 2, 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 2, 2018
@abadger
Copy link
Contributor Author

abadger commented May 2, 2018

Modified the change to skip setting permissions instead of trying to set permissions on the link when the target does not exist and follow=True. Also added a warning.

@nitzmahone nitzmahone self-requested a review May 2, 2018 20:06
@nitzmahone nitzmahone removed the needs_triage Needs a first human triage before being processed. label May 2, 2018
@abadger abadger added this to To Do in 2.5.x blocker list via automation May 2, 2018
We want to just emit the warning if the target of the link doesn't exist.
Otherwise we set attributes on the target
@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 4, 2018
@abadger abadger merged commit 4f664f8 into ansible:devel May 4, 2018
@abadger abadger deleted the fix-file-follow-bugs branch May 4, 2018 00:50
abadger added a commit to abadger/ansible that referenced this pull request May 4, 2018
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes ansible#39558

(cherry picked from commit 4f664f8)
@abadger
Copy link
Contributor Author

abadger commented May 4, 2018

Merged to devel. Opening a backport PR for 2.5

abadger added a commit that referenced this pull request May 4, 2018
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes #39558

(cherry picked from commit 4f664f8)
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 12, 2018
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes ansible#39558
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 14, 2018
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes ansible#39558
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 14, 2018
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes ansible#39558
tonal pushed a commit to tonal/ansible that referenced this pull request May 15, 2018
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes ansible#39558
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 15, 2018
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes ansible#39558
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 15, 2018
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes ansible#39558
ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes ansible#39558
@ansible ansible locked and limited conversation to collaborators May 7, 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
No open projects
Development

Successfully merging this pull request may close these issues.

ansible-2.5.2 file state=link force=yes no longer works
3 participants