cluster: RHEL511 - rgmanager: HA-LVM: strip spaces in lvm -o tags output

Ryan McCabe rmccabe at fedoraproject.org
Tue Oct 8 18:21:10 UTC 2013


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=22596e3be6ac4a997ed4823b210efc06703f408d
Commit:        22596e3be6ac4a997ed4823b210efc06703f408d
Parent:        bb3cf23ad9214086ec497f2368649501d8546c9e
Author:        Ryan McCabe <rmccabe at redhat.com>
AuthorDate:    Tue Oct 8 14:19:18 2013 -0400
Committer:     Ryan McCabe <rmccabe at redhat.com>
CommitterDate: Tue Oct 8 14:19:18 2013 -0400

rgmanager: HA-LVM: strip spaces in lvm -o tags output

Remove whitespace from 'lvm -o tags' output that caused
status checks to fail.

Resolves: rhbz#1016784

Patch from John Ruemker <jruemker at redhat.com>

Signed-off-by: Ryan McCabe <rmccabe at redhat.com>
---
 rgmanager/src/resources/lvm_by_lv.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/rgmanager/src/resources/lvm_by_lv.sh b/rgmanager/src/resources/lvm_by_lv.sh
index 7140076..ae8ff3a 100644
--- a/rgmanager/src/resources/lvm_by_lv.sh
+++ b/rgmanager/src/resources/lvm_by_lv.sh
@@ -158,7 +158,7 @@ lv_status_single()
 	#
 	# Verify that we are the correct owner
 	#
-	owner=`lvs -o tags --noheadings $lv_path`
+	owner=`lvs -o tags --noheadings $lv_path | tr -d ' '`
 	my_name=$(local_node_name)
 	if [ -z $my_name ]; then
 		ocf_log err "Unable to determine local machine name"
@@ -290,7 +290,7 @@ lv_activate_and_tag()
 lv_activate()
 {
 	declare lv_path="$OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-	declare owner=`lvs -o tags --noheadings $lv_path`
+	declare owner=`lvs -o tags --noheadings $lv_path | tr -d ' '`
 	declare my_name=$(local_node_name)
 
 	if [ -z $my_name ]; then
@@ -332,7 +332,7 @@ lv_activate()
 		    "activation { volume_list = \"$OCF_RESKEY_vg_name\" }" \
 		    $OCF_RESKEY_vg_name; then
 			ocf_log notice "$OCF_RESKEY_vg_name now consistent"
-			owner=`lvs -o tags --noheadings $lv_path`
+			owner=`lvs -o tags --noheadings $lv_path | tr -d ' '`
 			if [ ! -z $owner ] && [ $owner != $my_name ]; then
 				if is_node_member_clustat $owner ; then
 					ocf_log err "$owner owns $lv_path unable to $1"


More information about the cluster-commits mailing list