Skip to content

Commit 4fa31e2

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

File tree

13 files changed

+39
-0
lines changed

13 files changed

+39
-0
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

manifests/server/reassign_owned_by.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
$sql_command = "REASSIGN OWNED BY \"${old_role}\" TO \"${new_role}\""
2023

2124
$group = $postgresql::server::group

manifests/server/role.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
Optional[Enum['md5', 'scram-sha-256']] $hash = undef,
4646
Optional[Variant[String[1], Integer]] $salt = undef,
4747
) {
48+
if $port =~ String {
49+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
50+
}
4851
$password_hash_unsensitive = if $password_hash =~ Sensitive[String] {
4952
$password_hash.unwrap
5053
} else {

manifests/server/table_grant.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
Optional[Hash] $connect_settings = undef,
2626
Boolean $onlyif_exists = false,
2727
) {
28+
if $port =~ String {
29+
warning('Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
30+
}
2831
postgresql::server::grant { "table:${name}":
2932
ensure => $ensure,
3033
role => $role,

0 commit comments

Comments
 (0)