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

[CentOS] Use dnf instead of yum with Python 3 #301

Merged
merged 6 commits into from
Mar 16, 2021
Merged

Conversation

KSerrania
Copy link
Contributor

@KSerrania KSerrania commented Oct 1, 2020

What does this PR do?

Use the dnf task instead of yum when we detect that a Python 3 interpreter is used on a target host.
Add CentOS 8 tests to the CI.
Add Python 2 / Python 3 tests to the CI.

Motivation

The yum Python module is not compatible with Python 3.
Should fix #298.

Additional Notes

CentOS / RHEL < 8 + Python 3 interpreter is an invalid setup (you can't use the dnf module either because the python3-dnf package doesn't exist on these versions of CentOS), so we fail early in that case, with a helpful error message.

@KSerrania KSerrania force-pushed the kserrania/redhat-dnf branch 7 times, most recently from ce61d13 to 5ab9828 Compare January 28, 2021 10:47
@KSerrania KSerrania marked this pull request as ready for review January 28, 2021 16:33
@KSerrania KSerrania requested a review from a team as a code owner January 28, 2021 16:33
@KSerrania KSerrania changed the title Use dnf instead of yum [CentOS] Use dnf instead of yum with Python 3 Jan 28, 2021
.circleci/config.yml Outdated Show resolved Hide resolved
@KSerrania
Copy link
Contributor Author

I'm not 100% sure that we should fail hard when we detect Python 3 + CentOS < 8. On one side, it quickly gives a helpful message and avoids going through half of the role tasks only to find out that it doesn't work, but on the other side, there could be a case where someone backports dnf in their CentOS 7 box, in which case the role could succeed.

@mx-psi
Copy link
Member

mx-psi commented Jan 29, 2021

I'm not 100% sure that we should fail hard when we detect Python 3 + CentOS < 8. On one side, it quickly gives a helpful message and avoids going through half of the role tasks only to find out that it doesn't work, but on the other side, there could be a case where someone backports dnf in their CentOS 7 box, in which case the role could succeed.

We could add a flag to ignore the hard fail to deal with that edge case. I don't think it's a likely situation but it doesn't harm to have that flag I suppose.

@KSerrania KSerrania requested a review from a team as a code owner January 29, 2021 10:25
Copy link

@apigirl apigirl left a comment

Choose a reason for hiding this comment

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

👍 docs look good

@KSerrania KSerrania merged commit caa1b2b into master Mar 16, 2021
@KSerrania KSerrania deleted the kserrania/redhat-dnf branch March 16, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yum module is not supported with Python 3
3 participants