Skip to content

Commit fee21d8

Browse files
committed
Change selector statements to have default listed last
As per the official docs "the default case must be at the end of the list." http://docs.puppetlabs.com/puppet/latest/reference/lang_conditional.html#selectors This commit fixes breakage in Puppet 3.6.0 where it enforces the behavior described above when Future parser is enabled. See https://tickets.puppetlabs.com/browse/PUP-2642
1 parent d8fec75 commit fee21d8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

manifests/validate_db_connection.pp

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@
2121

2222
$cmd_init = "${psql_path} --tuples-only --quiet "
2323
$cmd_host = $database_host ? {
24+
undef => '',
2425
default => "-h ${database_host} ",
25-
undef => "",
2626
}
2727
$cmd_user = $database_username ? {
28+
undef => '',
2829
default => "-U ${database_username} ",
29-
undef => "",
3030
}
3131
$cmd_port = $database_port ? {
32+
undef => '',
3233
default => "-p ${database_port} ",
33-
undef => "",
3434
}
3535
$cmd_dbname = $database_name ? {
36-
default => "--dbname ${database_name} ",
3736
undef => "--dbname ${postgresql::params::default_database} ",
37+
default => "--dbname ${database_name} ",
3838
}
3939
$env = $database_password ? {
40-
default => "PGPASSWORD=${database_password}",
4140
undef => undef,
41+
default => "PGPASSWORD=${database_password}",
4242
}
4343
$cmd = join([$cmd_init, $cmd_host, $cmd_user, $cmd_port, $cmd_dbname])
4444
$validate_cmd = "/usr/local/bin/validate_postgresql_connection.sh ${sleep} ${tries} '${cmd}'"

0 commit comments

Comments
 (0)