Add strict validation about boolean parameters

This ensures the parameters used by if-else logic accept only boolean
values because non-boolean can result in unexpected behavior.

Change-Id: I666fea269663f219500c3a3ee748393c343b3f72
This commit is contained in:
Takashi Kajinami 2023-03-03 13:28:08 +09:00
parent 548d68cf35
commit ee865e8859
3 changed files with 6 additions and 0 deletions

View File

@ -242,6 +242,8 @@ define oslo::cache(
include oslo::params include oslo::params
validate_legacy(Boolean, 'validate_bool', $manage_backend_package)
if is_service_default($memcache_servers) { if is_service_default($memcache_servers) {
$memcache_servers_real = $memcache_servers $memcache_servers_real = $memcache_servers
} else { } else {

View File

@ -29,6 +29,9 @@ define oslo::coordination (
include oslo::params include oslo::params
validate_legacy(Boolean, 'validate_bool', $manage_backend_package)
validate_legacy(Boolean, 'validate_bool', $manage_config)
if $manage_backend_package and !is_service_default($backend_url){ if $manage_backend_package and !is_service_default($backend_url){
case $backend_url { case $backend_url {
/^redis:\/\//: { /^redis:\/\//: {

View File

@ -134,6 +134,7 @@ define oslo::db(
) { ) {
include oslo::params include oslo::params
validate_legacy(Boolean, 'validate_bool', $manage_backend_package)
if !is_service_default($connection) { if !is_service_default($connection) {