Blame SOURCES/bz1168251-SAPHana-agents-update2.patch

261ad6
diff --git a/heartbeat/SAPHana b/heartbeat/SAPHana
261ad6
index 412152b..1ff6a7d 100644
261ad6
--- a/heartbeat/SAPHana
261ad6
+++ b/heartbeat/SAPHana
261ad6
@@ -356,7 +356,8 @@ function get_hana_attribute()
261ad6
     local attr_node=$1
261ad6
     local attr_name=$2
261ad6
     local attr_store=${3:-reboot} # DONE: PRIO5 get this (optional) from parameter
261ad6
-    crm_attribute -N ${attr_node} -G -n "$attr_name" -l $attr_store -q; rc=$?
261ad6
+    local attr_default=${4:-}
261ad6
+    crm_attribute -N ${attr_node} -G -n "$attr_name" -l $attr_store -q -d "$attr_default"; rc=$?
261ad6
     super_ocf_log info "FLOW $FUNCNAME rc=$rc"
261ad6
     return $rc
261ad6
 }
261ad6
@@ -373,9 +374,10 @@ function set_hana_attribute()
261ad6
     local attr_value=$2
261ad6
     local attr_name=$3
261ad6
     local attr_store=${4:-reboot} # DONE: PRIO5 get this (optional) from parameter
261ad6
+    local attr_default=${5:-}
261ad6
     local rc=1
261ad6
     local attr_old=""
261ad6
-    attr_old=$(get_hana_attribute $attr_node $attr_name $attr_store); get_rc=$?
261ad6
+    attr_old=$(get_hana_attribute $attr_node $attr_name $attr_store $attr_default); get_rc=$?
261ad6
     if [ "$attr_old" != "$attr_value" ]; then
261ad6
         super_ocf_log debug "DBG: SET attribute $attr_name for node ${attr_node} to ${attr_value} former ($attr_old) get_rc=$get_rc "
261ad6
         crm_attribute -N $attr_node -v $attr_value -n "$attr_name" -l $attr_store; rc=$?
261ad6
@@ -578,8 +580,8 @@ function saphana_init() {
261ad6
     remoteHost=$(get_hana_attribute ${NODENAME} ${ATTR_NAME_HANA_REMOTEHOST[@]});
261ad6
     if [ -z "$remoteHost" ]; then
261ad6
        if [ ${#otherNodes[@]} -eq 1 ]; then # we are a 2 node cluster, lets assume the other is the remote-host
261ad6
-          remoteHost=${otherNodes[0]}
261ad6
-          remoteNode=$remoteHost
261ad6
+          remoteNode=${otherNodes[0]}
261ad6
+          remoteHost=$(get_hana_attribute $remoteNode ${ATTR_NAME_HANA_VHOST[@]} "$remoteNode");
261ad6
           super_ocf_log debug "DBG: auto-guess remoteHost=$remoteHost"
261ad6
        else
261ad6
           super_ocf_log debug "DBG: Could not auto-guess remoteHost out of list (${otherNodes[@]})"