Skip to content

Commit 9ce58b1

Browse files
committed
Fix postgresql::default() return value for unknown parameters
When calling `postgresql::default()` with a name that has no corresponding parameter, the function returns the string "postgresql::globals::<parameter-name>" which is probably not intended given the comment above the code. The usage of pick seems to indicate that an exception should be raised when a parameter is not found in `params` nor `globals.pp`, so adjust the code accordingly.
1 parent ba8e6d3 commit 9ce58b1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

functions/default.pp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ function postgresql::default(
1010

1111
#search for the variable name in params first
1212
#then fall back to globals if not found
13-
pick( getvar("postgresql::params::${parameter_name}"),
14-
"postgresql::globals::${parameter_name}")
13+
pick(getvar("postgresql::params::${parameter_name}"), getvar("postgresql::globals::${parameter_name}"))
1514
}

0 commit comments

Comments
 (0)