Skip to content

Commit

Permalink
(#1556) Fix Python package name for Ubuntu >= 22.04 and Debian 12
Browse files Browse the repository at this point in the history
For Ubuntu 22.04 and Debian 12 and later the Python PostgreSQL package
is called "python3-psycopg2" so make that distinction in params.pp.
  • Loading branch information
antaflos committed Nov 24, 2023
1 parent 25e45ee commit 9d4fc30
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,15 @@
$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')

$_ubuntu_2204 = ($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '22.04') >= 0)
$_debian_12 = ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['full'], '12') >= 0)

if $_ubuntu_2204 or $_debian_12 {
$python_package_name = pick($python_package_name, 'python3-psycopg2')
} else {
$python_package_name = pick($python_package_name, 'python-psycopg2')
}

$bindir = pick($bindir, "/usr/lib/postgresql/${version}/bin")
$datadir = pick($datadir, "/var/lib/postgresql/${version}/main")
Expand Down

0 comments on commit 9d4fc30

Please sign in to comment.