From 6da86c391f5e6efa4d1a5cf3c5cc2d66755192c7 Mon Sep 17 00:00:00 2001 From: yogananth subramanian Date: Thu, 17 Oct 2019 21:35:15 +0530 Subject: [PATCH] Fix upper case checks for SRIOV interface Allow using upper case names for SRIOV interface names. Fixes bug 1848483 Change-Id: I2d2cb42d87371f5807a4527eef22425416d4a774 (cherry picked from commit f5daa7698206dbfa652081f79b0e75075869db48) --- lib/puppet/type/sriov_vf_config.rb | 2 +- ...Fixes-SRIOV-upper-case-name-checks-306011421f53131d.yaml | 3 +++ spec/unit/type/sriov_vf_config_spec.rb | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/Fixes-SRIOV-upper-case-name-checks-306011421f53131d.yaml diff --git a/lib/puppet/type/sriov_vf_config.rb b/lib/puppet/type/sriov_vf_config.rb index 20746ef5a..78756997c 100644 --- a/lib/puppet/type/sriov_vf_config.rb +++ b/lib/puppet/type/sriov_vf_config.rb @@ -4,7 +4,7 @@ Puppet::Type.newtype(:sriov_vf_config) do newparam(:name) do desc "sriov_numvfs conf as :: format" - newvalues(/^[a-z0-9\-_]+:[0-9]+(:(switchdev|legacy))?$/) + newvalues(/^[a-zA-Z0-9\-_]+:[0-9]+(:(switchdev|legacy))?$/) end end diff --git a/releasenotes/notes/Fixes-SRIOV-upper-case-name-checks-306011421f53131d.yaml b/releasenotes/notes/Fixes-SRIOV-upper-case-name-checks-306011421f53131d.yaml new file mode 100644 index 000000000..9a75a0b79 --- /dev/null +++ b/releasenotes/notes/Fixes-SRIOV-upper-case-name-checks-306011421f53131d.yaml @@ -0,0 +1,3 @@ +--- +fixes: + - Allow using upper case names for SRIOV interface names. diff --git a/spec/unit/type/sriov_vf_config_spec.rb b/spec/unit/type/sriov_vf_config_spec.rb index 8891800b6..c59867bba 100644 --- a/spec/unit/type/sriov_vf_config_spec.rb +++ b/spec/unit/type/sriov_vf_config_spec.rb @@ -8,6 +8,12 @@ describe 'Puppet::Type.type(:sriov_vf_config)' do :ensure => 'present' )}.not_to raise_error end + it 'should allow name to be passed' do + expect{Puppet::Type.type(:sriov_vf_config).new( + :name => 'eTH0:10', + :ensure => 'present' + )}.not_to raise_error + end it 'should allow name to be passed with -' do expect{Puppet::Type.type(:sriov_vf_config).new( :name => 'eth-0:10',