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

file module: Fixed missing prev_state == 'directory' in file #5264

Merged
merged 1 commit into from Jan 6, 2014

Conversation

figpope
Copy link
Contributor

@figpope figpope commented Dec 12, 2013

In a previous pull request I had submitted a change that fixed an issue with using force == True on directories and symlinks. However, I had thought that the oversight was just in the if statement. After trying the same command on the latest version of ansible, I'm encountering a missing case in the confirmation of change. I've added the missing case below.

@figpope
Copy link
Contributor Author

figpope commented Dec 17, 2013

Any comments on this? Right now this oversight leaves undefined behavior in the codebase.

@jctanner
Copy link
Contributor

@drewlll2ll can you show me a way to reproduce the situation that this PR fixes?

@figpope
Copy link
Contributor Author

figpope commented Dec 18, 2013

@jctanner Try the following:

- name: Override directory with link
  file: state=link path=<existing directory> src=<directory to link from> force=yes

It produces

TASK: [vagrant | Link ubuntu user directory] **********************************
failed: [192.168.111.222] => {"dest": "/home/ubuntu", "failed": true, "gid": 1003, "group": "ubuntu", "item": "", "mode": "0755", "owner": "vagrant", "size": 4096, "src": "/home/vagrant", "state": "directory", "uid": 1000}
msg: unexpected position reached

@figpope
Copy link
Contributor Author

figpope commented Dec 23, 2013

@jctanner Any comments?

@figpope
Copy link
Contributor Author

figpope commented Dec 26, 2013

@jctanner Have you been able to reproduce this issue?

jctanner added a commit that referenced this pull request Jan 6, 2014
file module: Fixed missing prev_state == 'directory' in file
@jctanner jctanner merged commit aa1f9f2 into ansible:devel Jan 6, 2014
@jctanner
Copy link
Contributor

jctanner commented Jan 6, 2014

@drewlll2ll looks good, thanks!

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 5, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants