Blame SOURCES/bz1301189-virtualdomain-fix-locale.patch

937446
diff -uNr a/heartbeat/VirtualDomain b/heartbeat/VirtualDomain
937446
--- a/heartbeat/VirtualDomain	2016-01-25 12:05:30.437008638 +0100
937446
+++ b/heartbeat/VirtualDomain	2016-01-25 12:25:06.850256377 +0100
937446
@@ -282,12 +282,13 @@
937446
 	status="no state"
937446
 	while [ "$status" = "no state" ]; do
937446
 		try=$(($try + 1 ))
937446
-		status=$(virsh $VIRSH_OPTIONS domstate $DOMAIN_NAME 2>&1 | tr 'A-Z' 'a-z')
937446
+		status=$(LANG=C virsh $VIRSH_OPTIONS domstate $DOMAIN_NAME 2>&1 | tr 'A-Z' 'a-z')
937446
 		case "$status" in
937446
-			*"error:"*"domain not found"*|"shut off")
937446
+			*"error:"*"domain not found"|*"error:"*"failed to get domain"*|"shut off")
937446
 				# shut off: domain is defined, but not started, will not happen if
937446
 				#   domain is created but not defined
937446
-				# Domain not found: domain is not defined and thus not started
937446
+				# "Domain not found" or "failed to get domain": domain is not defined
937446
+				#   and thus not started
937446
 				ocf_log debug "Virtual domain $DOMAIN_NAME is not running: $(echo $status | sed s/error://g)"
937446
 				rc=$OCF_NOT_RUNNING
937446
 				;;
937446
@@ -415,11 +416,12 @@
937446
 	local status=0
937446
 
937446
 	ocf_log info "Issuing forced shutdown (destroy) request for domain ${DOMAIN_NAME}."
937446
-	out=$(virsh $VIRSH_OPTIONS destroy ${DOMAIN_NAME} 2>&1|tr 'A-Z' 'a-z')
937446
+	out=$(LANG=C virsh $VIRSH_OPTIONS destroy ${DOMAIN_NAME} 2>&1|tr 'A-Z' 'a-z')
937446
 	ex=$?
937446
 	echo >&2 "$out"
937446
 	case $ex$out in
937446
-		*"error:"*"domain is not running"*|*"error:"*"domain not found"*)
937446
+		*"error:"*"domain is not running"*|*"error:"*"domain not found"*|\
937446
+		*"error:"*"failed to get domain"*)
937446
 			: ;; # unexpected path to the intended outcome, all is well
937446
 		[!0]*)
937446
 			ocf_exit_reason "forced stop failed"