Skip to content

Commit 4e15857

Browse files
committed
Simplify postgresql::default()
`postgresql::params` inherits from `postgresql::globals` so any variable defined in `postgresql::globals` can be accessed by reading it from `postgresql::params`, making it redundant to check both. diff --git a/functions/default.pp b/functions/default.pp index e36610b..41b5006 100644 --- a/functions/default.pp +++ b/functions/default.pp @@ -8,8 +8,7 @@ function postgresql::default( ) { include postgresql::params - #search for the variable name in params first - #then fall back to globals if not found - pick(getvar("postgresql::params::${parameter_name}"), - getvar("postgresql::globals::${parameter_name}")) + # Search for the variable name in params. + # params inherits from globals, so it will also catch these variables. + pick(getvar("postgresql::params::${parameter_name}")) }
1 parent 6cb50cb commit 4e15857

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: functions/default.pp

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function postgresql::default(
88
) {
99
include postgresql::params
1010

11-
#search for the variable name in params first
12-
#then fall back to globals if not found
13-
pick(getvar("postgresql::params::${parameter_name}"), getvar("postgresql::globals::${parameter_name}"))
11+
# Search for the variable name in params.
12+
# params inherits from globals, so it will also catch these variables.
13+
pick(getvar("postgresql::params::${parameter_name}"))
1414
}

0 commit comments

Comments
 (0)