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

(#1556) Fix Python package name for Ubuntu >= 22.04 #1557

Merged
merged 1 commit into from Nov 24, 2023

Conversation

antaflos
Copy link
Contributor

Summary

For Ubuntu 22.04 and later the Python PostgreSQL package is called "python3-psycopg2" so make that distinction in params.pp.

Additional Context

This is missing spec tests but apparently there are no examples for Ubuntu past 18.04 so not sure where I would add tests to cover this change.

Related Issues (if any)

Fixes #1556

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

ekohl
ekohl previously approved these changes Nov 23, 2023
Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

In itself this is correct.

@@ -159,7 +159,12 @@
$perl_package_name = pick($perl_package_name, 'libdbd-pg-perl')
$plperl_package_name = pick($plperl_package_name, "postgresql-plperl-${version}")
$plpython_package_name = pick($plpython_package_name, "postgresql-plpython-${version}")
$python_package_name = pick($python_package_name, 'python-psycopg2')

if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '22.04') >= 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like the same is needed at least for Debian 12. For Debian 11 there still is python-psycopg2 as well as python3-psycopg2. Would you mind doing the same for Debian >= 12 at least while you're at it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added such a test for Debian 12 as well, trying to make the logic somewhat readable. Not sure if this is in tune with the module's coding style though.

…ian 12

For Ubuntu 22.04 and Debian 12 and later the Python PostgreSQL package
is called "python3-psycopg2" so make that distinction in params.pp.
@ekohl
Copy link
Collaborator

ekohl commented Nov 24, 2023

I don't see how the failing checks are related so I'm merging this

@ekohl ekohl merged commit fdd8f06 into puppetlabs:main Nov 24, 2023
35 of 40 checks passed
@Ramesh7 Ramesh7 added the bugfix label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tries to install the wrong Python PostgreSQL package on Ubuntu 22.04
4 participants