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

Allow updating the pyenv global versions file #204

Merged
merged 3 commits into from
Jun 16, 2023

Conversation

ni-fgenois
Copy link

Hello,

When setting the value of the pyenv_global variable to a different value than contained in the "{{ pyenv_path }}/version" file, the global version file is not updated. This is probably because of the following condition : https://github.com/staticdev/ansible-role-pyenv/blob/main/tasks/install.yml#L91 which skips running the command when the file already exists (https://docs.ansible.com/ansible/latest/collections/ansible/builtin/shell_module.html#parameter-creates)

We could remove that condition altogether, but this would always modify the file. We could also print & parse the globals as shown in this PR.

Let me know what you think!

(Also, thank you so much for maintaining this plugin!)

Copy link
Owner

@staticdev staticdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just removing lint error.

tasks/install.yml Outdated Show resolved Hide resolved
Copy link
Owner

@staticdev staticdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind fixing also these lint issues that showed up so can take a deeper look when pipeline are passing?

@staticdev
Copy link
Owner

Hello,

When setting the value of the pyenv_global variable to a different value than contained in the "{{ pyenv_path }}/version" file, the global version file is not updated. This is probably because of the following condition : https://github.com/staticdev/ansible-role-pyenv/blob/main/tasks/install.yml#L91 which skips running the command when the file already exists (https://docs.ansible.com/ansible/latest/collections/ansible/builtin/shell_module.html#parameter-creates)

We could remove that condition altogether, but this would always modify the file. We could also print & parse the globals as shown in this PR.

Let me know what you think!

(Also, thank you so much for maintaining this plugin!)

Thanks a lot for finding this and pointing this out! I will take a look into it very soon, meanwhile I saw some linting issues if you could check would be great.

@ni-fgenois
Copy link
Author

Linting errors should be fixed now!

@staticdev staticdev added the bug Something isn't working label Jun 16, 2023
@staticdev
Copy link
Owner

Thanks a lot, approved.

@staticdev staticdev merged commit 511f8f9 into staticdev:main Jun 16, 2023
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