X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-stx%2Frecipes-support%2Fpuppet%2Ffiles%2Fpuppetlabs-lvm%2FFix-the-logical-statement-for-nuke_fs_on_resize.patch;fp=meta-stx%2Frecipes-support%2Fpuppet%2Ffiles%2Fpuppetlabs-lvm%2FFix-the-logical-statement-for-nuke_fs_on_resize.patch;h=e1796ba3c037d3829ab6d6f415e2d8f3d0b83eb4;hb=57fdea704bd62af847872c40508f00aa1d7cac60;hp=0000000000000000000000000000000000000000;hpb=f23f21bccfb750b9e30141fd9676515215ffbc4e;p=pti%2Frtp.git diff --git a/meta-stx/recipes-support/puppet/files/puppetlabs-lvm/Fix-the-logical-statement-for-nuke_fs_on_resize.patch b/meta-stx/recipes-support/puppet/files/puppetlabs-lvm/Fix-the-logical-statement-for-nuke_fs_on_resize.patch new file mode 100644 index 0000000..e1796ba --- /dev/null +++ b/meta-stx/recipes-support/puppet/files/puppetlabs-lvm/Fix-the-logical-statement-for-nuke_fs_on_resize.patch @@ -0,0 +1,45 @@ +From 21d2c4e714611ad08e5aa999e555e1e7591f2717 Mon Sep 17 00:00:00 2001 +From: Kristine Bujold +Date: Thu, 19 Jul 2018 09:02:27 -0400 +Subject: [PATCH 1/1] Patch4: + Fix-the-logical-statement-for-nuke_fs_on_resize_2.patch + +--- + .../puppet/modules/lvm/lib/puppet/provider/logical_volume/lvm.rb | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/packstack/puppet/modules/lvm/lib/puppet/provider/logical_volume/lvm.rb b/packstack/puppet/modules/lvm/lib/puppet/provider/logical_volume/lvm.rb +index 2abfea3..f9b1c66 100755 +--- a/packstack/puppet/modules/lvm/lib/puppet/provider/logical_volume/lvm.rb ++++ b/packstack/puppet/modules/lvm/lib/puppet/provider/logical_volume/lvm.rb +@@ -184,13 +184,15 @@ Puppet::Type.type(:logical_volume).provide :lvm do + exec_cmd('umount', path) + exec_cmd('fsadm', '-y', 'check', path ) + r = exec_cmd('fsadm', '-y', 'resize', path, "#{new_size}k") +- if r[:exit] != 0 and @resource[:nuke_fs_on_resize_failure] ++ if r[:exit] != 0 and [:true, "true", true ].include? @resource[:nuke_fs_on_resize_failure] ++ info( "Failed 'fsadm resize' erase the disk #{r}" ) + exec_cmd('dd', 'if=/dev/zero', "of=#{path}", "bs=512", "count=16", "conv=notrunc") + blkid('-g') + end + r = exec_cmd('lvresize', '-r', '-f', '-L', "#{new_size}k", path) + if r[:exit] != 0 +- if @resource[:nuke_fs_on_resize_failure] ++ if [:true, "true", true ].include? @resource[:nuke_fs_on_resize_failure] ++ info( "Failed 'fsadm resize' erase the disk #{r}" ) + exec_cmd('dd', 'if=/dev/zero', "of=#{path}", "bs=512", "count=16", "conv=notrunc") + blkid('-g') + lvresize( '-f', '-L', "#{new_size}k", path) || fail( "Cannot reduce to size #{new_size} because lvresize failed." ) +@@ -215,7 +217,8 @@ Puppet::Type.type(:logical_volume).provide :lvm do + exec_cmd('umount', path) + exec_cmd('fsadm', '-y', 'check', path ) + r = exec_cmd('fsadm', '-y', 'resize', path, "#{new_size}k") +- if r[:exit] != 0 and @resource[:nuke_fs_on_resize_failure] ++ if r[:exit] != 0 and [:true, "true", true ].include? @resource[:nuke_fs_on_resize_failure] ++ info( "Failed 'fsadm resize' erase the disk #{r}" ) + exec_cmd('dd', 'if=/dev/zero', "of=#{path}", "bs=512", "count=16", "conv=notrunc") + blkid('-g') + end +-- +1.8.3.1 +