diff --git a/config/puppet-modules/puppet-lvm-1.4.0/debian/deb_folder/patches/0008-Fix-Ruby-csv.to_a.map-parsing-behavior-under-Debian.patch b/config/puppet-modules/puppet-lvm-1.4.0/debian/deb_folder/patches/0008-Fix-Ruby-csv.to_a.map-parsing-behavior-under-Debian.patch new file mode 100644 index 000000000..ce65b0da2 --- /dev/null +++ b/config/puppet-modules/puppet-lvm-1.4.0/debian/deb_folder/patches/0008-Fix-Ruby-csv.to_a.map-parsing-behavior-under-Debian.patch @@ -0,0 +1,39 @@ +From: Robert Church +Date: Tue, 19 Apr 2022 01:54:24 -0400 +Subject: Fix Ruby csv.to_a.map parsing behavior under Debian + +The output of "pvs -o pv_name,vg_name,lv_name --separator ','" is the +same under CentOS and Debian. This output is fed to the csv.to_a.map +function which produces a slightly different hash. + +Under Centos ruby (2.0.0): + {:_pv=>" /dev/sda5", :vg=>"cgts-vg", :lv=>"log-lv"} + +Under Debian ruby (2.7.4): + {:pv=>" /dev/sda7", :vg=>"cgts-vg", :lv=>"log-lv"} + +The '_pv' hash key is invalid under Debian and results in: + undefined method `strip' for nil:NilClass (NoMethodError) + +This patch corrects the variable reference + +Signed-off-by: Robert Church +--- + lib/puppet/provider/volume_group/lvm.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/puppet/provider/volume_group/lvm.rb b/lib/puppet/provider/volume_group/lvm.rb +index a6d4a70..9fa687f 100644 +--- a/lib/puppet/provider/volume_group/lvm.rb ++++ b/lib/puppet/provider/volume_group/lvm.rb +@@ -81,8 +81,8 @@ Puppet::Type.type(:volume_group).provide :lvm do + :headers => true, :header_converters => :symbol) + csv.to_a.map {|row| row.to_hash}.each do |m| + unless m[:lv].nil? +- pv_to_lv[m[:_pv].strip] = "#{m[:vg]}/#{m[:lv]}" +- pv_to_dev[m[:_pv].strip] = "#{m[:vg].gsub('-','--')}-#{m[:lv].gsub('-','--')}" ++ pv_to_lv[m[:pv].strip] = "#{m[:vg]}/#{m[:lv]}" ++ pv_to_dev[m[:pv].strip] = "#{m[:vg].gsub('-','--')}-#{m[:lv].gsub('-','--')}" + end + end + diff --git a/config/puppet-modules/puppet-lvm-1.4.0/debian/deb_folder/patches/series b/config/puppet-modules/puppet-lvm-1.4.0/debian/deb_folder/patches/series index a36c67d2a..8546b65bd 100644 --- a/config/puppet-modules/puppet-lvm-1.4.0/debian/deb_folder/patches/series +++ b/config/puppet-modules/puppet-lvm-1.4.0/debian/deb_folder/patches/series @@ -5,3 +5,4 @@ 0005-Fix-the-logical-statement-for-nuke_fs_on_resize.patch 0006-Wipe-10MB-after-we-lvextend-the-partitions.patch 0007-Debian-Fix-issue-on-re-install.patch +0008-Fix-Ruby-csv.to_a.map-parsing-behavior-under-Debian.patch