Merge "Fix controller swact error caused by drbd resizing"

This commit is contained in:
Zuul 2018-08-16 14:15:03 +00:00 committed by Gerrit Code Review
commit d4099628b2
3 changed files with 48 additions and 1 deletions

View File

@ -9,4 +9,4 @@ COPY_LIST="$CGCS_BASE/downloads/puppet/$PREFIX-$MODULE-$GIT_SHA.tar.gz $FILES_BA
TIS_PATCH_VER=4
TIS_PATCH_VER=5

View File

@ -0,0 +1,45 @@
From 21d2c4e714611ad08e5aa999e555e1e7591f2717 Mon Sep 17 00:00:00 2001
From: Kristine Bujold <kristine.bujold@windriver.com>
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

View File

@ -16,6 +16,7 @@ Patch0: 0001-puppet-lvm-kilo-quilt-changes.patch
Patch1: 0002-UEFI-pvcreate-fix.patch
Patch2: 0003-US94222-Persistent-Dev-Naming.patch
Patch3: 0004-extendind-nuke_fs_on_resize_failure-functionality.patch
Patch4: Fix-the-logical-statement-for-nuke_fs_on_resize.patch
BuildArch: noarch
@ -34,6 +35,7 @@ A Puppet module for Logical Resource Management (LVM)
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%install
install -d -m 0755 %{buildroot}/%{_datadir}/puppet/modules/%{module_dir}