Skip to content

Commit e5e6309

Browse files
committed
port parameter: log warning when its a string
1 parent 56bc346 commit e5e6309

16 files changed

+43
-4
lines changed

manifests/server.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@
196196
#Deprecated
197197
Optional[String[1]] $version = undef,
198198
) inherits postgresql::params {
199+
if $port =~ String {
200+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
201+
}
199202
if $version != undef {
200203
warning('Passing "version" to postgresql::server is deprecated; please use postgresql::globals instead.')
201204
$_version = $version

manifests/server/default_privileges.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
Variant[String[1], Stdlib::Absolutepath] $psql_path = $postgresql::server::psql_path,
3636
Optional[String] $target_role = undef,
3737
) {
38+
if $port =~ String {
39+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
40+
}
3841
# If possible use the version of the remote database, otherwise
3942
# fallback to our local DB version
4043
if $connect_settings != undef and 'DBVERSION' in $connect_settings {

manifests/server/extension.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
Hash $connect_settings = postgresql::default('default_connect_settings'),
3434
String[1] $database_resource_name = $database,
3535
) {
36+
if $port =~ String {
37+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
38+
}
3639
$user = postgresql::default('user')
3740
$group = postgresql::default('group')
3841
$psql_path = postgresql::default('psql_path')

manifests/server/grant.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
String $group = $postgresql::server::group,
4949
Variant[String[1], Stdlib::Absolutepath] $psql_path = $postgresql::server::psql_path,
5050
) {
51+
if $port =~ String {
52+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
53+
}
5154
case $ensure {
5255
default: {
5356
# default is 'present'

manifests/server/grant_role.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
Variant[String[1], Stdlib::Port] $port = $postgresql::server::port,
1717
Hash $connect_settings = $postgresql::server::default_connect_settings,
1818
) {
19+
if $port =~ String {
20+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
21+
}
1922
case $ensure {
2023
'present': {
2124
$command = "GRANT \"${group}\" TO \"${role}\""

manifests/server/instance/config.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@
7373
Optional[Postgresql::Pg_password_encryption] $password_encryption = $postgresql::server::password_encryption,
7474
Optional[String] $extra_systemd_config = $postgresql::server::extra_systemd_config,
7575
) {
76+
if $port =~ String {
77+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
78+
}
7679
if ($manage_pg_hba_conf == true) {
7780
# Prepare the main pg_hba file
7881
concat { $pg_hba_conf_path:

manifests/server/instance/late_initdb.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
Variant[String[1], Stdlib::Port] $port = $postgresql::server::port,
2020
String[1] $module_workdir = $postgresql::server::module_workdir,
2121
) {
22+
if $port =~ String {
23+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
24+
}
2225
# Set the defaults for the postgresql_psql resource
2326
Postgresql_psql {
2427
psql_user => $user,

manifests/server/instance/passwd.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
String[1] $module_workdir = $postgresql::server::module_workdir,
2323
Optional[Variant[String[1], Sensitive[String[1]], Integer]] $postgres_password = $postgresql::server::postgres_password,
2424
) {
25+
if $port =~ String {
26+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
27+
}
2528
$real_postgres_password = if $postgres_password =~ Sensitive {
2629
$postgres_password.unwrap
2730
} else {

manifests/server/instance/service.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
Variant[String[1], Stdlib::Absolutepath] $psql_path = $postgresql::server::psql_path,
3131
Hash $connect_settings = $postgresql::server::default_connect_settings,
3232
) {
33+
if $port =~ String {
34+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
35+
}
3336
anchor { "postgresql::server::service::begin::${name}": }
3437

3538
if $service_manage {

manifests/server/instance/systemd.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
Enum[present, absent] $drop_in_ensure = 'present',
1111

1212
) {
13+
if $port =~ String {
14+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
15+
}
1316
# Template uses:
1417
# - $port
1518
# - $datadir

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy