Use validate_legacy to validae parameter types.
This change replaces usage of is_a and is_hash to validate parameter types. Expecially the is_hash function has been deprecated and using the function is now discouraged. Change-Id: Ia09387e5704a57287575f3602e56a8b584bb4d6d
This commit is contained in:
parent
ada04652a7
commit
c7966378a0
|
@ -311,6 +311,9 @@ class ironic::inspector (
|
|||
$db_connection = undef,
|
||||
) {
|
||||
|
||||
validate_legacy(Array, 'validate_array', $dnsmasq_ip_subnets)
|
||||
validate_legacy(Hash, 'validate_hash', $port_physnet_cidr_map)
|
||||
|
||||
include ironic::deps
|
||||
include ironic::params
|
||||
include ironic::pxe::common
|
||||
|
@ -332,14 +335,6 @@ Use ironic::inspector::ironic::endpoint_override instead.')
|
|||
include ironic::inspector::authtoken
|
||||
}
|
||||
|
||||
if !is_array($dnsmasq_ip_subnets) {
|
||||
fail('Invalid data type, parameter dnsmasq_ip_subnets must be Array type')
|
||||
}
|
||||
|
||||
if !is_hash($port_physnet_cidr_map) {
|
||||
fail('Invalid data type, parameter port_physnet_cidr_map mush be Hash type')
|
||||
}
|
||||
|
||||
$tftp_root_real = pick($::ironic::pxe::common::tftp_root, $tftp_root)
|
||||
$http_root_real = pick($::ironic::pxe::common::http_root, $http_root)
|
||||
$http_port_real = pick($::ironic::pxe::common::http_port, $http_port)
|
||||
|
|
Loading…
Reference in New Issue