Blame SOURCES/bz1029061-virtualdomain-parse-error.patch

aba6ec
From bd3b09252eedbeeab2635f82259714975702257e Mon Sep 17 00:00:00 2001
aba6ec
From: David Vossel <dvossel@redhat.com>
aba6ec
Date: Mon, 20 Jan 2014 10:29:23 -0600
aba6ec
Subject: [PATCH] High: VirtualDomain: Fixes parsing domain name from xml file.
aba6ec
aba6ec
If the domain xml is not generated by virsh, it is possible
aba6ec
VirtualDomain will not be able to detect the domain's name
aba6ec
from the xml file.  This is a result of the parsing command
aba6ec
not taking into account trailing whitespace characters.
aba6ec
---
aba6ec
 heartbeat/VirtualDomain | 2 +-
aba6ec
 1 file changed, 1 insertion(+), 1 deletion(-)
aba6ec
aba6ec
diff --git a/heartbeat/VirtualDomain b/heartbeat/VirtualDomain
aba6ec
index 3ca4f6d..11c8df9 100755
aba6ec
--- a/heartbeat/VirtualDomain
aba6ec
+++ b/heartbeat/VirtualDomain
aba6ec
@@ -565,7 +565,7 @@ if [ ! -r $OCF_RESKEY_config ]; then
aba6ec
 fi
aba6ec
 
aba6ec
 # Retrieve the domain name from the xml file.
aba6ec
-DOMAIN_NAME=`egrep '.*<name>.*</name>$' ${OCF_RESKEY_config} | sed -e 's/.*<name>\(.*\)<\/name>$/\1/' 2>/dev/null`
aba6ec
+DOMAIN_NAME=`egrep '[[:space:]]*<name>.*</name>[[:space:]]*$' ${OCF_RESKEY_config} | sed -e 's/[[:space:]]*<name>\(.*\)<\/name>[[:space:]]*$/\1/' 2>/dev/null`
aba6ec
 if [ -z $DOMAIN_NAME ]; then
aba6ec
 	ocf_log err "This is unexpected. Cannot determine domain name."
aba6ec
 	exit $OCF_ERR_GENERIC
aba6ec
-- 
aba6ec
1.8.4.2
aba6ec