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:
Takashi Kajinami 2021-05-04 17:11:09 +09:00
parent ada04652a7
commit c7966378a0
1 changed files with 3 additions and 8 deletions

View File

@ -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)