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: I8c2bd97681130da33974e4ea707f77f44e160ce2
This commit is contained in:
parent
9ae179cd51
commit
15124a60a2
@ -31,6 +31,9 @@ class zaqar::server(
|
||||
include zaqar::params
|
||||
include zaqar::policy
|
||||
|
||||
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
||||
validate_legacy(Boolean, 'validate_bool', $enabled)
|
||||
|
||||
if $manage_service {
|
||||
if $enabled {
|
||||
$ensure = 'running'
|
||||
|
@ -24,6 +24,8 @@ define zaqar::server_instance(
|
||||
include zaqar::deps
|
||||
include zaqar::params
|
||||
|
||||
validate_legacy(Boolean, 'validate_bool', $enabled)
|
||||
|
||||
if $enabled {
|
||||
$service_ensure = 'running'
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user