Validate integer parameters

The following parameters accept only integers. This adds validation
to enforce the proper type.
 - other_config:vlan-limit
 - other_config:n-revalidator-threads
 - other_config:n-handler-threads

Change-Id: I359d6ef5eb24fe4d7cc1070aabc6ca5256d7f3b5
This commit is contained in:
Takashi Kajinami
2023-02-25 23:44:01 +09:00
parent 2b10d0e53c
commit 257b703572
2 changed files with 14 additions and 0 deletions

View File

@@ -127,6 +127,16 @@ class vswitch::dpdk (
validate_legacy(Hash, 'validate_hash', $vs_config)
validate_legacy(Boolean, 'validate_bool', $skip_restart)
if $vlan_limit != undef {
validate_legacy(Integer, 'validate_integer', $vlan_limit)
}
if $revalidator_cores != undef {
validate_legacy(Integer, 'validate_integer', $revalidator_cores)
}
if $handler_cores != undef {
validate_legacy(Integer, 'validate_integer', $handler_cores)
}
$restart = !$skip_restart
kmod::load { 'vfio-pci': }

View File

@@ -51,6 +51,10 @@ class vswitch::ovs(
validate_legacy(Hash, 'validate_hash', $vs_config)
validate_legacy(Boolean, 'validate_bool', $skip_restart)
if $vlan_limit != undef {
validate_legacy(Integer, 'validate_integer', $vlan_limit)
}
$restart = !$skip_restart
if $enable_hw_offload {