--- old/usr/src/cmd/ha-services/gds-agents/xvm/functions.ksh Tue Jul 28 04:24:03 2009 +++ new/usr/src/cmd/ha-services/gds-agents/xvm/functions.ksh Tue Jul 28 04:24:03 2009 @@ -74,12 +74,17 @@ LOG_STRING=$(/usr/bin/printf "$@") ${LOGGER} -p ${PRI} -t ${TAG} ${LOG_STRING} fi +} - if [[ "${METHOD}" == "validate" ]] - then - shift 5 - /usr/bin/printf "$@" - fi +i18n_message() +{ + debug_message "Function: i18n_message - Begin" + ${DEBUG} + + print -u2 $(/bin/printf "$@") + + debug_message "Function: i18n_message - End" + return 0 } debug_message() @@ -214,6 +219,7 @@ ${SET_DEBUG} typeset rc=0 + typeset msgtext if [ "$(/usr/bin/uname -i)" != "i86xpv" ] then @@ -226,6 +232,9 @@ scds_syslog -p daemon.error -t $(syslog_tag) -m \ "Node is not booted with xVM." + msgtext=$(gettext "Node is not booted with xVM.") + i18n_message "${msgtext}" + rc=1 fi @@ -240,21 +249,45 @@ ${SET_DEBUG} typeset ncount=0 + typeset msgtext # Make sure that the password file is readable. - if [ ! -r "${PASSWORD_FILE}" ] + if [[ ${MIGRATION_TYPE} != "NORMAL" ]] then - # SCMSGS - # @explanation - # Incorrect Password file specified. - # @user_action - # Ensure that a valid password file is specified. - scds_syslog -p daemon.error -t $(syslog_tag) -m \ - "Invalid password file specified %s." \ - "${PASSWORD_FILE}" + if [ -z "${PASSWORD_FILE}" ] + then + # SCMSGS + # @explanation + # Password file cannot be null. + # @user_action + # Ensure that a password file name is specified. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Password file cannot be (null)." - debug_message "Function: validate_ldom - End" - return 1 + msgtext=$(gettext "Password file cannot be (null).") + i18n_message "${msgtext}" + + debug_message "Function: validate_ldom - End" + return 1 + fi + + if [[ ! -f "${PASSWORD_FILE}" ]] || [[ ! -r "${PASSWORD_FILE}" ]] + then + # SCMSGS + # @explanation + # Incorrect Password file specified. + # @user_action + # Ensure that a valid password file is specified. + scds_syslog -p daemon.error -t $(syslog_tag) -m \ + "Invalid password file specified %s." \ + "${PASSWORD_FILE}" + + msgtext=$(gettext "Invalid password file specified %s.") + i18n_message "${msgtext}" "${PASSWORD_FILE}" + + debug_message "Function: validate_ldom - End" + return 1 + fi fi # Ensure that the control domain is a cluster node. @@ -269,7 +302,10 @@ scds_syslog -p daemon.error -t $(syslog_tag) -m \ "The LDom Manager is running in configuration mode." - debug_message "Function: validate_ldom - End" + msgtext=$(gettext "The LDom Manager is running in configuration mode.") + i18n_message "${msgtext}" + + debug_message "Function: validate_ldom - End" return 1 fi @@ -291,6 +327,9 @@ "Invalid failure policy \"%s\" for %s domain." \ "${policy}" "primary" + msgtext=$(gettext "Invalid failure policy \"%s\" for %s domain.") + i18n_message "${msgtext}" "${policy}" "primary" + debug_message "Function: validate_ldom - End" return 1 fi @@ -319,7 +358,6 @@ nodeid=$(${SCHA_CLUSTER_GET} -O NODEID_NODENAME ${nodename}) output=$(${CL_EXEC_CLIENT} -n ${nodeid} -c "${LDM} list-domain ${DOMAIN}") result=${?} - status=$(echo ${output} | ${AWK} '{print $6}') if (( ${result} == 0 )) && (( ${status} == 0 )) @@ -337,6 +375,9 @@ "Domain %s is in %s state on %s." \ "${DOMAIN}" "${domstate}" "${nodename}" + msgtext=$(gettext "Domain %s is in %s state on %s.") + i18n_message "${msgtext}" "${DOMAIN}" "${domstate}" "${nodename}" + debug_message "Function: validate_ldom - End" return 1 fi @@ -363,6 +404,10 @@ scds_syslog -p daemon.error -t $(syslog_tag) -m \ "Domain %s does not exist." \ "${DOMAIN}" + + msgtext=$(gettext "Domain %s does not exist.") + i18n_message "${msgtext}" "${DOMAIN}" + return 1 fi fi @@ -379,6 +424,10 @@ scds_syslog -p daemon.error -t $(syslog_tag) -m \ "Multiple domain %s configuration exists on %s." \ "${DOMAIN}" "${nlist}" + + msgtext=$(gettext "Multiple domain %s configuration exists on %s.") + i18n_message "${msgtext}" "${DOMAIN}" "${nlist}" + return 1 fi @@ -407,6 +456,9 @@ "Invalid user probe file %s." \ "${PLUGIN_PROBE}" + msgtext=$(gettext "Invalid user probe file %s.") + i18n_message "${msgtext}" "${PLUGIN_PROBE}" + return 1 fi fi