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: I491cc86eb105bc5484ed60c605183859b40696c2
This commit is contained in:
parent
8b8659e8ca
commit
ec281aacc7
@ -92,6 +92,9 @@ class ironic::api (
|
|||||||
include ironic::policy
|
include ironic::policy
|
||||||
include ironic::api::authtoken
|
include ironic::api::authtoken
|
||||||
|
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $enabled)
|
||||||
|
|
||||||
# Configure ironic.conf
|
# Configure ironic.conf
|
||||||
ironic_config {
|
ironic_config {
|
||||||
'api/host_ip': value => $host_ip;
|
'api/host_ip': value => $host_ip;
|
||||||
|
@ -286,6 +286,9 @@ class ironic::conductor (
|
|||||||
include ironic::deps
|
include ironic::deps
|
||||||
include ironic::params
|
include ironic::params
|
||||||
|
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $enabled)
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
||||||
|
|
||||||
# For backward compatibility
|
# For backward compatibility
|
||||||
include ironic::glance
|
include ironic::glance
|
||||||
|
|
||||||
|
@ -154,6 +154,9 @@ class ironic::drivers::pxe (
|
|||||||
) inherits ironic::params {
|
) inherits ironic::params {
|
||||||
|
|
||||||
include ironic::deps
|
include ironic::deps
|
||||||
|
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $enable_ppc64le)
|
||||||
|
|
||||||
include ironic::pxe::common
|
include ironic::pxe::common
|
||||||
$tftp_root_real = pick($::ironic::pxe::common::tftp_root, $tftp_root)
|
$tftp_root_real = pick($::ironic::pxe::common::tftp_root, $tftp_root)
|
||||||
$ipxe_timeout_real = pick($::ironic::pxe::common::ipxe_timeout, $ipxe_timeout)
|
$ipxe_timeout_real = pick($::ironic::pxe::common::ipxe_timeout, $ipxe_timeout)
|
||||||
|
@ -238,6 +238,12 @@ class ironic::inspector (
|
|||||||
$uefi_ipxe_bootfile_name = $::ironic::params::uefi_ipxe_bootfile_name,
|
$uefi_ipxe_bootfile_name = $::ironic::params::uefi_ipxe_bootfile_name,
|
||||||
) inherits ironic::params {
|
) inherits ironic::params {
|
||||||
|
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $enabled)
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $dhcp_debug)
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $dnsmasq_dhcp_sequential_ip)
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $sync_db)
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $enable_ppc64le)
|
||||||
validate_legacy(Array, 'validate_array', $dnsmasq_ip_subnets)
|
validate_legacy(Array, 'validate_array', $dnsmasq_ip_subnets)
|
||||||
validate_legacy(Hash, 'validate_hash', $port_physnet_cidr_map)
|
validate_legacy(Hash, 'validate_hash', $port_physnet_cidr_map)
|
||||||
|
|
||||||
|
@ -103,6 +103,8 @@ class ironic::json_rpc (
|
|||||||
|
|
||||||
include ironic::deps
|
include ironic::deps
|
||||||
|
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $use_ssl)
|
||||||
|
|
||||||
if is_service_default($system_scope) {
|
if is_service_default($system_scope) {
|
||||||
$project_name_real = $project_name
|
$project_name_real = $project_name
|
||||||
$project_domain_name_real = $project_domain_name
|
$project_domain_name_real = $project_domain_name
|
||||||
|
@ -113,6 +113,10 @@ class ironic::pxe (
|
|||||||
include ironic::deps
|
include ironic::deps
|
||||||
include ironic::pxe::common
|
include ironic::pxe::common
|
||||||
|
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $enabled)
|
||||||
|
validate_legacy(Boolean, 'validate_bool', $manage_http_server)
|
||||||
|
|
||||||
$tftp_root_real = pick($::ironic::pxe::common::tftp_root, $tftp_root)
|
$tftp_root_real = pick($::ironic::pxe::common::tftp_root, $tftp_root)
|
||||||
$http_root_real = pick($::ironic::pxe::common::http_root, $http_root)
|
$http_root_real = pick($::ironic::pxe::common::http_root, $http_root)
|
||||||
$http_port_real = pick($::ironic::pxe::common::http_port, $http_port)
|
$http_port_real = pick($::ironic::pxe::common::http_port, $http_port)
|
||||||
|
Loading…
Reference in New Issue
Block a user