Skip to content

Remove has_key usage #1425

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

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions manifests/server/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@

# If possible use the version of the remote database, otherwise
# fallback to our local DB version
if $connect_settings != undef and has_key( $connect_settings, 'DBVERSION') {
if $connect_settings != undef and 'DBVERSION' in $connect_settings {
$version = $connect_settings['DBVERSION']
} else {
$version = $postgresql::server::_version
}

# If the connection settings do not contain a port, then use the local server port
if $connect_settings != undef and has_key( $connect_settings, 'PGPORT') {
if $connect_settings != undef and 'PGPORT' in $connect_settings {
$port = undef
} else {
$port = $postgresql::server::port
Expand Down
4 changes: 2 additions & 2 deletions manifests/server/default_privileges.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
) {
# If possible use the version of the remote database, otherwise
# fallback to our local DB version
if $connect_settings != undef and has_key( $connect_settings, 'DBVERSION') {
if $connect_settings != undef and 'DBVERSION' in $connect_settings {
$version = $connect_settings['DBVERSION']
} else {
$version = $postgresql::server::_version
Expand All @@ -64,7 +64,7 @@
#
if $port != undef {
$port_override = $port
} elsif $connect_settings != undef and has_key( $connect_settings, 'PGPORT') {
} elsif $connect_settings != undef and 'PGPORT' in $connect_settings {
$port_override = undef
} else {
$port_override = $postgresql::server::port
Expand Down
2 changes: 1 addition & 1 deletion manifests/server/extension.pp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#
if $port != undef {
$port_override = $port
} elsif $connect_settings != undef and has_key( $connect_settings, 'PGPORT') {
} elsif $connect_settings != undef and 'PGPORT' in $connect_settings {
$port_override = undef
} else {
$port_override = $postgresql::server::port
Expand Down
2 changes: 1 addition & 1 deletion manifests/server/grant.pp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#
if $port != undef {
$port_override = $port
} elsif $connect_settings != undef and has_key( $connect_settings, 'PGPORT') {
} elsif $connect_settings != undef and 'PGPORT' in $connect_settings {
$port_override = undef
} else {
$port_override = $postgresql::server::port
Expand Down
2 changes: 1 addition & 1 deletion manifests/server/reassign_owned_by.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#
if $port != undef {
$port_override = $port
} elsif $connect_settings != undef and has_key( $connect_settings, 'PGPORT') {
} elsif $connect_settings != undef and 'PGPORT' in $connect_settings {
$port_override = undef
} else {
$port_override = $postgresql::server::port
Expand Down
4 changes: 2 additions & 2 deletions manifests/server/role.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
#
if $port != undef {
$port_override = $port
} elsif $connect_settings != undef and has_key( $connect_settings, 'PGPORT') {
} elsif $connect_settings != undef and 'PGPORT' in $connect_settings {
$port_override = undef
} else {
$port_override = $postgresql::server::port
}

# If possible use the version of the remote database, otherwise
# fallback to our local DB version
if $connect_settings != undef and has_key( $connect_settings, 'DBVERSION') {
if $connect_settings != undef and 'DBVERSION' in $connect_settings {
$version = $connect_settings['DBVERSION']
} else {
$version = $postgresql::server::_version
Expand Down
2 changes: 1 addition & 1 deletion manifests/server/schema.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Postgresql::Server::Db <| dbname == $db |> -> Postgresql::Server::Schema[$name]

# If the connection settings do not contain a port, then use the local server port
if $connect_settings != undef and has_key( $connect_settings, 'PGPORT') {
if $connect_settings != undef and 'PGPORT' in $connect_settings {
$port = undef
} else {
$port = $postgresql::server::port
Expand Down
2 changes: 1 addition & 1 deletion manifests/server/tablespace.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$module_workdir = $postgresql::server::module_workdir

# If the connection settings do not contain a port, then use the local server port
if $connect_settings != undef and has_key( $connect_settings, 'PGPORT') {
if $connect_settings != undef and 'PGPORT' in $connect_settings {
$port = undef
} else {
$port = $postgresql::server::port
Expand Down