File bug-728579_glue-stonith-dev-id.patch of Package cluster-glue

# HG changeset patch
# Parent 58686d5ae302fffcf62ca337cefcaf792e47014a
Low: stonith: add CRM stonith resource name to log messages

diff -r 58686d5ae302 lib/stonith/ha_log.sh
--- a/lib/stonith/ha_log.sh	Tue Mar 13 16:53:03 2012 +0100
+++ b/lib/stonith/ha_log.sh	Tue Mar 13 17:10:30 2012 +0100
@@ -54,16 +54,24 @@ level_pres() {
 	esac
 }
 
+set_logtag() {
+	# add parent pid to the logtag
+	if [ "$HA_LOGTAG" ]; then
+		if [ -n "$CRM_meta_st_device_id" ]; then
+			HA_LOGTAG="$HA_LOGTAG($CRM_meta_st_device_id)[$PPID]"
+		else
+			HA_LOGTAG="$HA_LOGTAG[$PPID]"
+		fi
+	fi
+}
+
 ha_log() {
 	loglevel=$1
 	shift
 	prn_level=`level_pres $loglevel`
 	msg="$prn_level: $@"
 
-	# add parent pid to the logtag
-	if [ "$HA_LOGTAG" ]; then
-		HA_LOGTAG="$HA_LOGTAG[$PPID]"
-	fi
+	set_logtag
 
 	# if we're connected to a tty, then output to stderr
 	if tty >/dev/null; then
openSUSE Build Service is sponsored by