From c2a3cdbfaba723031c4d3b66055d4b5956501878 Mon Sep 17 00:00:00 2001 From: Peter Pitterling Date: Fri, 30 Sep 2022 10:33:55 +0200 Subject: [PATCH] Expanding an array without an index only gives the first element. array $FUNCNAME is used in each function for logging use better syntax and replace $FUNCNAME --> ${FUNCNAME[0]} https://www.shellcheck.net/wiki/SC2128 --- ra/SAPHana | 166 ++++++++++++++++++++++----------------------- ra/SAPHanaTopology | 60 ++++++++-------- 2 files changed, 113 insertions(+), 113 deletions(-) diff --git a/ra/SAPHana b/ra/SAPHana index 318c176f..b095167b 100755 --- a/ra/SAPHana +++ b/ra/SAPHana @@ -116,7 +116,7 @@ function super_ocf_log() { # globals: $0(r) # function saphana_usage() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 methods=$(saphana_methods) methods=$(echo $methods | tr ' ' '|') @@ -141,11 +141,11 @@ EOF } function backup_global_and_nameserver() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 cp /hana/shared/${SID}/global/hdb/custom/config/global.ini /hana/shared/${SID}/global/hdb/custom/config/global.ini.$(date +"%s") cp /hana/shared/${SID}/global/hdb/custom/config/nameserver.ini /hana/shared/${SID}/global/hdb/custom/config/nameserver.ini.$(date +"%s") - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -155,7 +155,7 @@ function backup_global_and_nameserver() { # globals: - # function saphana_meta_data() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # cat <>$log_attr_file; rc=$? ;; esac - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -498,7 +498,7 @@ function get_hana_attribute() # function set_hana_attribute() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local attr_node=$1 local attr_value=$2 local attr_name=$3 @@ -528,7 +528,7 @@ function set_hana_attribute() super_ocf_log debug "DBG: LET attribute $attr_name for node ${attr_node} still be ${attr_value}" rc=0 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -538,7 +538,7 @@ function set_hana_attribute() # globals: OCF_*(r) # function assert() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local err_msg=$1 local default_rc=$OCF_NOT_RUNNING # DONE: Check, if we need to distinguish between probe and others @@ -562,7 +562,7 @@ function assert() { # function set_crm_master() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 local score=0 if [ -n "$1" ]; then @@ -591,7 +591,7 @@ function set_crm_master() # scoring_crm_master() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local roles="$1" local sync="$2" local skip=0 @@ -624,7 +624,7 @@ scoring_crm_master() # function get_crm_master() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 ${HA_SBIN_DIR}/crm_master -G -q -l reboot; rc=$? return $rc @@ -788,7 +788,7 @@ function set_SRHOOK() # saphana_init : Define global variables with default values, if optional parameters are not set # function saphana_init() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_SUCCESS local clN SYSTEMCTL="/usr/bin/systemctl" @@ -1010,7 +1010,7 @@ function saphana_init() { hdbState="hdbnsutil -sr_state" hdbMap="hdbnsutil -sr_state" fi - super_ocf_log info "FLOW $FUNCNAME rc=$OCF_SUCCESS" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$OCF_SUCCESS" return $OCF_SUCCESS } @@ -1021,7 +1021,7 @@ function saphana_init() { # TODO: PRIO5: Might be dropped, if we get a script for fetching the sync status function check_secstore_users() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local user="" local rc=1 while [ $# -gt 0 ]; do @@ -1029,7 +1029,7 @@ function check_secstore_users() $DIR_EXECUTABLE/hdbuserstore list | grep -q "KEY $user" && echo "$user" && rc=0 && break shift done - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1108,7 +1108,7 @@ handle_unix_domain_sockets() { # check_sapstartsrv : Before using sapcontrol we make sure that the sapstartsrv is running. # function check_sapstartsrv() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local restart=0 local runninginst="" local rc=$OCF_SUCCESS @@ -1202,12 +1202,12 @@ function check_sapstartsrv() { # globals: - # function cleanup_instance() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # TODO: PRIO5: Check, if we need HANA cleanup procedure (processes, ipc obj, pid files); Currently not needed super_ocf_log debug "DBG: cleanup_instance currently not implemented" rc=0 - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" } # @@ -1216,7 +1216,7 @@ function cleanup_instance() { # globals: HANA_STATE_PRIMARY(r), HANA_STATE_SECONDARY(r), HANA_STATE_DEFECT(r) # function check_for_primary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$HANA_STATE_DEFECT # TODO: PRIO 3: Check beginning from which SPS does SAP support HDBSettings.sh? # DONE: Limit the runtime of hdbnsutil and use getParameter.py as fallback @@ -1268,7 +1268,7 @@ function check_for_primary() { esac; sleep 2 done - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1285,7 +1285,7 @@ function check_for_primary() { # Active = 15 function analyze_hana_sync_statusSRS() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=-1 srRc=0 all_nodes_other_side="" n="" siteParam="" if [ -n "$remSR_name" ]; then siteParam="--site=$remSR_name" @@ -1297,7 +1297,7 @@ function analyze_hana_sync_statusSRS() # SAP_CALL FULL_SR_STATUS=$(HANA_CALL --timeout 5 --cmd "cdpy; python systemReplicationStatus.py $siteParam" 2>/dev/null); srRc=$? super_ocf_log info "DEC $FUNCNAME systemReplicationStatus.py (to site '$remSR_name')-> $srRc" - super_ocf_log info "FLOW $FUNCNAME systemReplicationStatus.py (to site '$remSR_name')-> $srRc" + super_ocf_log info "FLOW ${FUNCNAME[0]} systemReplicationStatus.py (to site '$remSR_name')-> $srRc" # # TODO: PRIO2: Here we might also need to filter additional sites (if multi tier should be supported) # And is the check for return code capable for chains? @@ -1305,14 +1305,14 @@ function analyze_hana_sync_statusSRS() if [ $srRc -eq 15 ]; then # Fix for a HANA BUG, where a non-working SR resulted in RC 15: if grep -q "ACTIVE" <<< "$FULL_SR_STATUS"; then - super_ocf_log info "FLOW $FUNCNAME SOK" + super_ocf_log info "FLOW ${FUNCNAME[0]} SOK" set_hana_attribute "$remoteNode" "SOK" "${ATTR_NAME_HANA_SYNC_STATUS[@]}" super_ocf_log info "ACT site=$sr_name, setting SOK for secondary (1)" lpa_set_lpt 30 "$remoteNode" rc=0; else # ok we should be careful and set secondary to SFAIL - super_ocf_log info "FLOW $FUNCNAME SFAIL" + super_ocf_log info "FLOW ${FUNCNAME[0]} SFAIL" set_hana_attribute "$remoteNode" "SFAIL" "${ATTR_NAME_HANA_SYNC_STATUS[@]}" super_ocf_log info "ACT site=$sr_name, setting SFAIL for secondary (6) - srRc=$srRc lss=$lss No ACTIVES found in cmd output" # TODO: PRIO1 - P004: need to check LSS again to avoid dying primary to block (SFAIL) secondary @@ -1326,7 +1326,7 @@ function analyze_hana_sync_statusSRS() rc=2 else # ok we should be careful and set secondary to SFAIL - super_ocf_log info "FLOW $FUNCNAME SFAIL" + super_ocf_log info "FLOW ${FUNCNAME[0]} SFAIL" set_hana_attribute "$remoteNode" "SFAIL" "${ATTR_NAME_HANA_SYNC_STATUS[@]}" super_ocf_log info "ACT site=$sr_name, setting SFAIL for secondary (5) - srRc=$srRc lss=$lss" # TODO: PRIO1 - P004: need to check LSS again to avoid dying primary to block (SFAIL) secondary @@ -1334,16 +1334,16 @@ function analyze_hana_sync_statusSRS() rc=1 fi else - super_ocf_log info "FLOW $FUNCNAME SFAIL" + super_ocf_log info "FLOW ${FUNCNAME[0]} SFAIL" set_hana_attribute "$remoteNode" "SFAIL" "${ATTR_NAME_HANA_SYNC_STATUS[@]}" super_ocf_log info "ACT site=$sr_name, setting SFAIL for secondary (2) - srRc=$srRc" # TODO: PRIO1 - P004: need to check LSS again to avoid dying primary to block (SFAIL) secondary lpa_set_lpt 10 "$remoteNode" rc=1; fi - super_ocf_log info "FLOW $FUNCNAME PRIM+LPA" + super_ocf_log info "FLOW ${FUNCNAME[0]} PRIM+LPA" super_ocf_log info "DBG PRIM" - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1358,7 +1358,7 @@ function analyze_hana_sync_statusSRS() # function analyze_hana_sync_statusSQL() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local -a clusterNodes=() local cl="" local vHost="" @@ -1427,7 +1427,7 @@ function analyze_hana_sync_statusSQL() # function get_hana_landscape_status() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # # TODO: Get rid of the su by using a new interface: @@ -1456,7 +1456,7 @@ function get_hana_landscape_status() # function register_hana_secondary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=2; local remoteInstance=""; local newParameter=0 @@ -1495,7 +1495,7 @@ function register_hana_secondary() super_ocf_log info "ACT: SAPHANA DROP REGISTER because AUTOMATED_REGISTER is set to FALSE" rc=1 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc; } @@ -1516,7 +1516,7 @@ function saphana_status() { # globals: OCF_*, SAPCONTROL, InstanceNr, SID, InstanceName, # function saphana_start() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_NOT_RUNNING local output="" local loopcount=0 @@ -1552,7 +1552,7 @@ function saphana_start() { super_ocf_log err "ACT: SAPHANA Instance $SID-$InstanceName start failed: $output" rc=$OCF_ERR_GENERIC fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1563,7 +1563,7 @@ function saphana_start() { # saphana_stop: Stop the SAP instance # function saphana_stop() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local output="" local rc=0 check_sapstartsrv; rc=$? @@ -1588,7 +1588,7 @@ function saphana_stop() { super_ocf_log err "ACT: SAP Instance $SID-$InstanceName stop failed: $output" rc=$OCF_ERR_GENERIC fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1599,7 +1599,7 @@ function saphana_stop() { # saphana_validate: Check the semantic of the input parameters # function saphana_validate() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_SUCCESS # # SID is Alpha-AlphaNumeric-Alphanumeric? @@ -1617,7 +1617,7 @@ function saphana_validate() { super_ocf_log err "ACT: Parsing instance profile name: '$InstanceNr' is not a valid instance number!" rc=$OCF_ERR_ARGS fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1628,7 +1628,7 @@ function saphana_validate() { # function saphana_start_primary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local primary_status sync_attr score_master rc=$OCF_NOT_RUNNING local lss sqlrc; local rc=0 @@ -1789,7 +1789,7 @@ function saphana_start_primary() rc="$OCF_NOT_RUNNING" ;; esac - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1800,7 +1800,7 @@ function saphana_start_primary() # check_for_primary_master() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=1 local ch ch_role # @@ -1823,7 +1823,7 @@ check_for_primary_master() fi done fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1838,7 +1838,7 @@ wait_for_primary_master() local rc=1 local loops=${1:-0} local count=0 - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" # # hana_ndb_roles=primary:master1:master:worker:master # @@ -1857,7 +1857,7 @@ wait_for_primary_master() sleep 10 fi done - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1868,7 +1868,7 @@ wait_for_primary_master() # function saphana_start_secondary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local primary_status sync_attr score_master rc=$OCF_NOT_RUNNING local sqlrc; set_crm_master 0 @@ -1910,7 +1910,7 @@ function saphana_start_secondary() set_crm_master -INFINITY rc=$OCF_SUCCESS fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1928,7 +1928,7 @@ function saphana_check_local_instance() local SERVNO local output local MONITOR_SERVICES="hdbnameserver|hdbdaemon" # TODO: PRIO1: exact list of Services - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" check_sapstartsrv rc=$? if [ $rc -eq $OCF_SUCCESS ] @@ -1970,7 +1970,7 @@ function saphana_check_local_instance() fi fi fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1982,7 +1982,7 @@ function saphana_check_local_instance() # globals: LPA_ATTR_*, # function lpa_get_lpt() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=1 local node=$1 local lpt="" @@ -1993,7 +1993,7 @@ function lpa_get_lpt() { else rc=2 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2004,7 +2004,7 @@ function lpa_get_lpt() { # rc: rc=0: OK, rc=1: InternalERROR, rc=2: ERROR # function lpa_set_lpt() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=1 local crm_rc=1 local lpt=$1 @@ -2021,7 +2021,7 @@ function lpa_set_lpt() { else super_ocf_log info "DEC: lpa_set_lpt - ignore to change value for empty node name" fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2033,7 +2033,7 @@ function lpa_set_lpt() { # rc: rc=0: OK, rc=1: InternalERROR, rc=2: ERROR # function lpa_pull_lpt() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=1 local lpt="" local readrest=0 @@ -2047,7 +2047,7 @@ function lpa_pull_lpt() { else rc=2 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2059,7 +2059,7 @@ function lpa_pull_lpt() { # rc: rc=0: OK, rc=1: InternalERROR, rc=2: ERROR # function lpa_push_lpt() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local lpt=$1 local clpt=-1 local rc=1 @@ -2073,7 +2073,7 @@ function lpa_push_lpt() { else rc=0 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2091,7 +2091,7 @@ function lpa_push_lpt() { # PRIMARY sets to 1 # function lpa_init_lpt() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=1 local LPTloc=-1 local LPTrem=-1 @@ -2111,7 +2111,7 @@ function lpa_init_lpt() { rc=2 fi lpa_set_lpt $LPTloc "$NODENAME" - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2150,7 +2150,7 @@ function lpa_init_lpt() { # WAIT ==> like STALEMATE-HANDLING ===> rc=2 (wait) # function lpa_check_lpt_status() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=4 local LPTloc=-1 local LPTrem=-1 @@ -2206,7 +2206,7 @@ function lpa_check_lpt_status() { rc=2 fi fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2217,10 +2217,10 @@ function lpa_check_lpt_status() { # globals: function is_the_master_nameserver() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # always true for scale-up - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2231,7 +2231,7 @@ function is_the_master_nameserver() # saphana_start_clone # function saphana_start_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local primary_status sync_attr score_master rc=$OCF_NOT_RUNNING local sqlrc; set_hana_attribute "${NODENAME}" "DEMOTED" "${ATTR_NAME_HANA_CLONE_STATE[@]}" @@ -2245,7 +2245,7 @@ function saphana_start_clone() { super_ocf_log error "SAP HANA is neither PRIMARY nor SECONDARY cant start this SAP HANA database for SR control." rc="$OCF_NOT_RUNNING" fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2256,7 +2256,7 @@ function saphana_start_clone() { # saphana_stop_clone # function saphana_stop_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 local primary_status="x" set_hana_attribute "${NODENAME}" "UNDEFINED" "${ATTR_NAME_HANA_CLONE_STATE[@]}" @@ -2317,7 +2317,7 @@ function recover_site_attributes_from_file() # function saphana_monitor_primary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_ERR_GENERIC local promoted=0 local init_attribute=0 @@ -2363,7 +2363,7 @@ function saphana_monitor_primary() # lpa - no need to wait any longer - lets try a new start saphana_start_clone rc=$? - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc ;; 2 ) @@ -2555,7 +2555,7 @@ function saphana_monitor_primary() fi ;; esac - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2567,7 +2567,7 @@ function saphana_monitor_primary() # function saphana_monitor_secondary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_ERR_GENERIC local promoted=0 local init_attribute=0 @@ -2679,7 +2679,7 @@ function saphana_monitor_secondary() rc=$OCF_NOT_RUNNING ;; esac - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2690,7 +2690,7 @@ function saphana_monitor_secondary() # saphana_monitor_clone # function saphana_monitor_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" # # TODO: PRIO3: For the secondary, which is missing the primary (so in status WAITING) what is better: # a) returning 7 here and force cluster a restart of the secondary @@ -2748,7 +2748,7 @@ function saphana_monitor_clone() { rc=$OCF_ERR_GENERIC fi fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2760,7 +2760,7 @@ function saphana_monitor_clone() { # In a multi-state configuration get Master being the primary OR by running hana takeover # function saphana_promote_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc="$OCF_SUCCESS"; local hana_sync; local primary_status; @@ -2832,7 +2832,7 @@ function saphana_promote_clone() { set_SRHOOK "$sr_name" "PRIM" fi fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -2846,12 +2846,12 @@ function saphana_promote_clone() { # correct monitor return codes # function saphana_demote_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_ERR_GENERIC; set_hana_attribute "${NODENAME}" "DEMOTED" "${ATTR_NAME_HANA_CLONE_STATE[@]}" rc=$OCF_SUCCESS; super_ocf_log info "ACT: Demoted $SID-$InstanceName." - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } diff --git a/ra/SAPHanaTopology b/ra/SAPHanaTopology index 047d1dd8..d78a934a 100755 --- a/ra/SAPHanaTopology +++ b/ra/SAPHanaTopology @@ -100,7 +100,7 @@ function super_ocf_log() { # globals: $0(r) # function sht_usage() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 methods=$(sht_methods) methods=$(echo $methods | tr ' ' '|') @@ -128,7 +128,7 @@ function sht_usage() { # globals: - # function sht_meta_data() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 cat < @@ -216,7 +216,7 @@ return $rc # function get_hana_attribute() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 local attr_node=$1 local attr_name=$2 @@ -234,7 +234,7 @@ function get_hana_attribute() crm_attribute -G -n "$attr_name" -t crm_config -q -d "$attr_default" 2>>$log_attr_file; rc=$? ;; esac - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -245,7 +245,7 @@ function get_hana_attribute() # function set_hana_attribute() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local attr_node=$1 local attr_value=$2 local attr_name=$3 @@ -272,7 +272,7 @@ function set_hana_attribute() super_ocf_log debug "DBG: LET attribute $attr_name for node ${attr_node} still be ${attr_value}" rc=0 fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -283,7 +283,7 @@ function set_hana_attribute() # methods: What methods/operations do we support? # function sht_methods() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 cat <<-! start @@ -358,7 +358,7 @@ function version() { # Special EXIT of RA, if clone is missconfigured # function is_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # # is a clone config? @@ -376,7 +376,7 @@ function is_clone() { else rc=1; fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -478,7 +478,7 @@ function HANA_CALL() # function sht_init() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local myInstanceName="" local rc=$OCF_SUCCESS local hdbANSWER="" @@ -674,7 +674,7 @@ function sht_init() { done super_ocf_log info "DEC: site=$site, mode=$srmode, hanaRemoteHost=$hanaRemoteHost - found by remote site ($hanaSite)" fi - super_ocf_log info "FLOW $FUNCNAME rc=$OCF_SUCCESS" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$OCF_SUCCESS" return $OCF_SUCCESS } @@ -684,25 +684,25 @@ function sht_init() { # globals: srmode(r), HANA_STATE_PRIMARY(r), HANA_STATE_SECONDARY(r), HANA_STATE_DEFECT(r), HANA_STATE_STANDALONE(r) # function check_for_primary() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 super_ocf_log debug "DBG: check_for_primary: srmode=$srmode" case "$srmode" in primary ) - super_ocf_log info "FLOW $FUNCNAME rc=HANA_STATE_PRIMARY" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=HANA_STATE_PRIMARY" rc=$HANA_STATE_PRIMARY;; syncmem | sync | async ) - super_ocf_log info "FLOW $FUNCNAME rc=HANA_STATE_SECONDARY" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=HANA_STATE_SECONDARY" rc=$HANA_STATE_SECONDARY;; none ) # have seen that mode on second side BEFEORE we registered it as replica - super_ocf_log info "FLOW $FUNCNAME rc=HANA_STATE_STANDALONE" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=HANA_STATE_STANDALONE" rc=$HANA_STATE_STANDALONE;; * ) dump=$( echo $srmode | hexdump -C ); super_ocf_log err "ACT: check_for_primary: we didn't expect srmode to be: DUMP: <$dump>" rc=$HANA_STATE_DEFECT esac; - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -809,7 +809,7 @@ function check_saphostagent() # sht_start : Start the SAP HANA instance # function sht_start() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_NOT_RUNNING local output="" @@ -828,7 +828,7 @@ function sht_start() { rc=$OCF_SUCCESS - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -839,7 +839,7 @@ function sht_start() { # sht_stop: Stop the SAP HANA Topology Resource # function sht_stop() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local output="" local rc=0 if [ -f $HA_RSCTMP/SAPHana/SAPTopologyON ]; then @@ -848,7 +848,7 @@ function sht_stop() { rm $HA_RSCTMP/SAPHana/SAPTopologyON.${SID} rc=$OCF_SUCCESS - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -860,7 +860,7 @@ function sht_stop() { # sht_monitor: Can the given SAP instance do anything useful? # function sht_monitor() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 # check for old status file if [ -f $HA_RSCTMP/SAPHana/SAPTopologyON ]; then @@ -872,7 +872,7 @@ function sht_monitor() { else rc=$OCF_NOT_RUNNING fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -884,7 +884,7 @@ function sht_monitor() { # sht_status: Lightweight check of SAP instance only with OS tools # function sht_status() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 sht_monitor; rc=$? @@ -899,7 +899,7 @@ function sht_status() { # sht_validate: Check the symantic of the input parameters # function sht_validate() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_SUCCESS if [ $(echo "$SID" | grep -c '^[A-Z][A-Z0-9][A-Z0-9]$') -ne 1 ] then @@ -913,7 +913,7 @@ function sht_validate() { rc=$OCF_ERR_ARGS fi - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -924,7 +924,7 @@ function sht_validate() { # sht_start_clone # function sht_start_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=$OCF_NOT_RUNNING sht_start; rc=$? return $rc @@ -937,7 +937,7 @@ function sht_start_clone() { # sht_stop_clone # function sht_stop_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 check_for_primary; primary_status=$? if [ $primary_status -eq $HANA_STATE_PRIMARY ]; then @@ -961,7 +961,7 @@ function sht_stop_clone() { # sht_monitor_clone # function sht_monitor_clone() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" # local rc=$OCF_ERR_GENERIC local promoted=0 @@ -1102,7 +1102,7 @@ function sht_monitor_clone() { esac # fi # end ocf_is_NOT_probe - super_ocf_log info "FLOW $FUNCNAME rc=$rc" + super_ocf_log info "FLOW ${FUNCNAME[0]} rc=$rc" return $rc } @@ -1113,7 +1113,7 @@ function sht_monitor_clone() { # sht_notify: Handle master scoring - to make sure a slave gets the next master # function sht_notify() { - super_ocf_log info "FLOW $FUNCNAME ($*)" + super_ocf_log info "FLOW ${FUNCNAME[0]} ($*)" local rc=0 super_ocf_log info "RA ==== end action $ACTION$CLACT (${n_type}/${n_op})====" return $rc