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: I7259bf90853bd0ac24b7a60de9c43145c64015ba
This commit is contained in:
parent
c6e82df318
commit
2eec46b764
@ -89,6 +89,10 @@ class manila::api (
|
||||
include manila::policy
|
||||
require keystone::client
|
||||
|
||||
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
||||
validate_legacy(Boolean, 'validate_bool', $enabled)
|
||||
validate_legacy(Boolean, 'validate_bool', $sync_db)
|
||||
|
||||
if $::manila::params::api_package {
|
||||
package { 'manila-api':
|
||||
ensure => $package_ensure,
|
||||
|
@ -36,6 +36,9 @@ class manila::data (
|
||||
include manila::deps
|
||||
include manila::params
|
||||
|
||||
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
||||
validate_legacy(Boolean, 'validate_bool', $enabled)
|
||||
|
||||
if $::manila::params::data_package {
|
||||
package { 'manila-data':
|
||||
ensure => $package_ensure,
|
||||
|
@ -251,6 +251,8 @@ class manila (
|
||||
include manila::deps
|
||||
include manila::db
|
||||
|
||||
validate_legacy(Boolean, 'validate_bool', $use_ssl)
|
||||
|
||||
if $use_ssl {
|
||||
if !$cert_file {
|
||||
fail('The cert_file parameter is required when use_ssl is set to true')
|
||||
|
@ -30,6 +30,9 @@ class manila::scheduler (
|
||||
include manila::deps
|
||||
include manila::params
|
||||
|
||||
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
||||
validate_legacy(Boolean, 'validate_bool', $enabled)
|
||||
|
||||
if $scheduler_driver {
|
||||
manila_config {
|
||||
'DEFAULT/scheduler_driver': value => $scheduler_driver
|
||||
|
@ -24,6 +24,9 @@ class manila::share (
|
||||
include manila::deps
|
||||
include manila::params
|
||||
|
||||
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
||||
validate_legacy(Boolean, 'validate_bool', $enabled)
|
||||
|
||||
if $::manila::params::share_package {
|
||||
package { 'manila-share':
|
||||
ensure => $package_ensure,
|
||||
|
Loading…
x
Reference in New Issue
Block a user