From 4a257936a5f64eb6d38f911a7152a27c4a95477f Mon Sep 17 00:00:00 2001 From: Stefan Berg Date: Fri, 27 Nov 2020 16:21:23 +0100 Subject: [PATCH 1/3] Update interface.pp --- manifests/interface.pp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/manifests/interface.pp b/manifests/interface.pp index 34b486d..de92e22 100644 --- a/manifests/interface.pp +++ b/manifests/interface.pp @@ -504,23 +504,24 @@ include ::network - validate_re($ensure, '^(present|absent)$', "Ensure can only be present or absent (to add or remove an interface). Current value: ${ensure}") - validate_bool($auto) - validate_bool($enable) - validate_bool($restart_all_nic) - - validate_array($up) - validate_array($pre_up) - validate_array($down) - validate_array($pre_down) - validate_array($slaves) - validate_array($bond_slaves) - validate_array($bridge_ports) - validate_array($wpa_key_mgmt) - validate_array($wpa_group) - validate_array($wpa_pairwise) - validate_array($wpa_auth_alg) - validate_array($wpa_proto) + validate_legacy(Enum['present', 'absent'], 'validate_re', $ensure, [['^present$', '^absent$'], "Ensure can only be present or absent (to add or remove an interface). Current value: ${ensure}"]) + + validate_legacy(Boolean, 'validate_bool',$auto) + validate_legacy(Boolean, 'validate_bool',$enable) + validate_legacy(Boolean, 'validate_bool',$restart_all_nic) + + validate_legacy(Array, 'validate_array', $up) + validate_legacy(Array, 'validate_array', $pre_up) + validate_legacy(Array, 'validate_array', $down) + validate_legacy(Array, 'validate_array', $pre_down) + validate_legacy(Array, 'validate_array', $slaves) + validate_legacy(Array, 'validate_array', $bond_slaves) + validate_legacy(Array, 'validate_array', $bridge_ports) + validate_legacy(Array, 'validate_array', $wpa_key_mgmt) + validate_legacy(Array, 'validate_array', $wpa_group) + validate_legacy(Array, 'validate_array', $wpa_pairwise) + validate_legacy(Array, 'validate_array', $wpa_auth_alg) + validate_legacy(Array, 'validate_array', $wpa_proto) # $subchannels is only valid for zLinux/SystemZ/s390x. if $::architecture == 's390x' { From 6c915913587cbcde8ad2520f41b34eac3a3715b2 Mon Sep 17 00:00:00 2001 From: Stefan Berg Date: Fri, 27 Nov 2020 16:26:01 +0100 Subject: [PATCH 2/3] Revert "Update interface.pp" This reverts commit 4a257936a5f64eb6d38f911a7152a27c4a95477f. --- manifests/interface.pp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/manifests/interface.pp b/manifests/interface.pp index de92e22..34b486d 100644 --- a/manifests/interface.pp +++ b/manifests/interface.pp @@ -504,24 +504,23 @@ include ::network - validate_legacy(Enum['present', 'absent'], 'validate_re', $ensure, [['^present$', '^absent$'], "Ensure can only be present or absent (to add or remove an interface). Current value: ${ensure}"]) - - validate_legacy(Boolean, 'validate_bool',$auto) - validate_legacy(Boolean, 'validate_bool',$enable) - validate_legacy(Boolean, 'validate_bool',$restart_all_nic) - - validate_legacy(Array, 'validate_array', $up) - validate_legacy(Array, 'validate_array', $pre_up) - validate_legacy(Array, 'validate_array', $down) - validate_legacy(Array, 'validate_array', $pre_down) - validate_legacy(Array, 'validate_array', $slaves) - validate_legacy(Array, 'validate_array', $bond_slaves) - validate_legacy(Array, 'validate_array', $bridge_ports) - validate_legacy(Array, 'validate_array', $wpa_key_mgmt) - validate_legacy(Array, 'validate_array', $wpa_group) - validate_legacy(Array, 'validate_array', $wpa_pairwise) - validate_legacy(Array, 'validate_array', $wpa_auth_alg) - validate_legacy(Array, 'validate_array', $wpa_proto) + validate_re($ensure, '^(present|absent)$', "Ensure can only be present or absent (to add or remove an interface). Current value: ${ensure}") + validate_bool($auto) + validate_bool($enable) + validate_bool($restart_all_nic) + + validate_array($up) + validate_array($pre_up) + validate_array($down) + validate_array($pre_down) + validate_array($slaves) + validate_array($bond_slaves) + validate_array($bridge_ports) + validate_array($wpa_key_mgmt) + validate_array($wpa_group) + validate_array($wpa_pairwise) + validate_array($wpa_auth_alg) + validate_array($wpa_proto) # $subchannels is only valid for zLinux/SystemZ/s390x. if $::architecture == 's390x' { From ce42041d754c6bbc570ef1934b9e0b3b95b207b8 Mon Sep 17 00:00:00 2001 From: Stefan Berg Date: Fri, 27 Nov 2020 16:26:26 +0100 Subject: [PATCH 3/3] deprecation warnings removed using validate_legacy instead of validate_bool, validate_re and validate_array --- manifests/interface.pp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/manifests/interface.pp b/manifests/interface.pp index 34b486d..de92e22 100644 --- a/manifests/interface.pp +++ b/manifests/interface.pp @@ -504,23 +504,24 @@ include ::network - validate_re($ensure, '^(present|absent)$', "Ensure can only be present or absent (to add or remove an interface). Current value: ${ensure}") - validate_bool($auto) - validate_bool($enable) - validate_bool($restart_all_nic) - - validate_array($up) - validate_array($pre_up) - validate_array($down) - validate_array($pre_down) - validate_array($slaves) - validate_array($bond_slaves) - validate_array($bridge_ports) - validate_array($wpa_key_mgmt) - validate_array($wpa_group) - validate_array($wpa_pairwise) - validate_array($wpa_auth_alg) - validate_array($wpa_proto) + validate_legacy(Enum['present', 'absent'], 'validate_re', $ensure, [['^present$', '^absent$'], "Ensure can only be present or absent (to add or remove an interface). Current value: ${ensure}"]) + + validate_legacy(Boolean, 'validate_bool',$auto) + validate_legacy(Boolean, 'validate_bool',$enable) + validate_legacy(Boolean, 'validate_bool',$restart_all_nic) + + validate_legacy(Array, 'validate_array', $up) + validate_legacy(Array, 'validate_array', $pre_up) + validate_legacy(Array, 'validate_array', $down) + validate_legacy(Array, 'validate_array', $pre_down) + validate_legacy(Array, 'validate_array', $slaves) + validate_legacy(Array, 'validate_array', $bond_slaves) + validate_legacy(Array, 'validate_array', $bridge_ports) + validate_legacy(Array, 'validate_array', $wpa_key_mgmt) + validate_legacy(Array, 'validate_array', $wpa_group) + validate_legacy(Array, 'validate_array', $wpa_pairwise) + validate_legacy(Array, 'validate_array', $wpa_auth_alg) + validate_legacy(Array, 'validate_array', $wpa_proto) # $subchannels is only valid for zLinux/SystemZ/s390x. if $::architecture == 's390x' {