From ee865e885949ab00e6fb2075d4b50504cbd7a351 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 3 Mar 2023 13:28:08 +0900 Subject: [PATCH] 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 --- manifests/cache.pp | 2 ++ manifests/coordination.pp | 3 +++ manifests/db.pp | 1 + 3 files changed, 6 insertions(+) diff --git a/manifests/cache.pp b/manifests/cache.pp index 88e08ba..7e8a5fd 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -242,6 +242,8 @@ define oslo::cache( include oslo::params + validate_legacy(Boolean, 'validate_bool', $manage_backend_package) + if is_service_default($memcache_servers) { $memcache_servers_real = $memcache_servers } else { diff --git a/manifests/coordination.pp b/manifests/coordination.pp index 4b4e83f..52502a5 100644 --- a/manifests/coordination.pp +++ b/manifests/coordination.pp @@ -29,6 +29,9 @@ define oslo::coordination ( 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){ case $backend_url { /^redis:\/\//: { diff --git a/manifests/db.pp b/manifests/db.pp index ee6bc31..9a535bb 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -134,6 +134,7 @@ define oslo::db( ) { include oslo::params + validate_legacy(Boolean, 'validate_bool', $manage_backend_package) if !is_service_default($connection) {