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

Improve symlink recreation logic #120

Merged
merged 1 commit into from
Feb 25, 2022
Merged

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea requested a review from webknjaz as a code owner February 25, 2022 14:25
@ssbarnea ssbarnea added the bug Something isn't working label Feb 25, 2022
@github-actions github-actions bot added the enhancement New feature or request label Feb 25, 2022
@ssbarnea ssbarnea removed the enhancement New feature or request label Feb 25, 2022
@ssbarnea ssbarnea merged commit 7391b66 into ansible:main Feb 25, 2022
@ssbarnea ssbarnea deleted the fix/symlink branch February 25, 2022 15:02
@ghost
Copy link

ghost commented Mar 9, 2022

@ssbarnea I can confirm that since 2.0.0, we are now getting the error you have linked. WIth version 1.0.0 of ansible-compat, things work fine. Here is the matrix that I've tested with Jenkins:

molecule 3.5.2 + ansible-compat 1.0.0: working
molecule 3.5.2 + ansible-compat 2.0.0: working
molecule 3.6.1 + ansible-compat 1.0.0: working
molecule 3.6.1 + ansible-compat 2.0.0: not working

The error message is similar to "FileExistsError: [Errno 17] File exists: '/home/runner/work/molecule/molecule/src/molecule/test/scenarios/driver/delegated' -> '/home/runner/.ansible/roles/molecule.delegated_test'"

UPDATE: Some additional context
The issue exists with a standalone role that holds a meta/main.yml only (so no galaxy.yml in the project's root dir)

@ghost
Copy link

ghost commented Mar 14, 2022

@ssbarnea For python 3.8 at least, we are having the issue that exists and is_symlink show different behaviors.

Here is what the docu says:
If the path points to a symlink, exists() returns whether the symlink points to an existing file or directory.

For the is_symlink:
Return True if the path points to a symbolic link, False otherwise.
False is also returned if the path doesn’t exist; other errors (such as permission errors) are propagated.

In our case / scenario, a link exists and does not get removed as the condition now returns false. For us - in order to make use of ansible-compat 2.0.0 - we need to revert this change here.

Let me know if that works for you. Thanks!

@ssbarnea
Copy link
Member Author

I would gladly review pull requests. Keep in mind that ansible-compat 2.0 should be used with upcoming molecule v4. I would recommend adding a ansible-compat<2.0 to molecule stable 3.x branch, so we avoid using it.

This week I am focusing on releasing ansible-lint v6, but once that goes out, I should have time to focus on molecule v4.

@ghost
Copy link

ghost commented Mar 14, 2022

Thanks @ssbarnea . I wasn't aware that ansible-compat 2.0 was targeted at molecule v4.x.
We'll then fix the ansible-compat version until we move to molecule v4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants