--- old/usr/src/cmd/ha-services/gds-agents/xvm/Makefile Tue Jul 28 04:23:58 2009 +++ new/usr/src/cmd/ha-services/gds-agents/xvm/Makefile Tue Jul 28 04:23:58 2009 @@ -35,7 +35,7 @@ include $(SRC)/Makefile.subdirs # list common shell scripts for $(PKGNAME)/bin -KSH_BIN_SRCS = control_xvm.ksh \ +KSH_SRCS = control_xvm.ksh \ functions.ksh \ validate_xvm.ksh \ init_xvm.ksh \ @@ -42,7 +42,7 @@ ldm_migrate.ksh \ ppkssh.ksh -PROG = $(KSH_BIN_SRCS:%.ksh=%) +PROG = $(KSH_SRCS:%.ksh=%) include $(SRC)/cmd/Makefile.cmd @@ -50,11 +50,12 @@ PKGNAME = SUNWscxvm RTRFILE = SUNW.xvm SUNW.ldom -# Disable I18N stuff, the po filename needs to be unique to support parallel -# builds of the agents below gds-agents -POFILE= $(PKGNAME).po -PIFILES= +TEXT_DOMAIN = SUNW_SC_XVM +MESSAGE_DIR = /opt/$(PKGNAME)/lib/locale +POFILE = xvm.po +PIFILES = $(KSH_SRCS:%.ksh=%.pi) + # Disable lint LINTFILES= --- old/usr/src/cmd/ha-services/gds-agents/xvm/SUNW.ldom Tue Jul 28 04:24:00 2009 +++ new/usr/src/cmd/ha-services/gds-agents/xvm/SUNW.ldom Tue Jul 28 04:24:00 2009 @@ -341,6 +341,7 @@ PROPERTY = Password_file; EXTENSION; STRING; + DEFAULT = ""; TUNABLE = WHEN_DISABLED; DESCRIPTION = "The complete path to the file containing the target host password"; } --- 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 --- old/usr/src/cmd/ha-services/gds-agents/xvm/validate_xvm.ksh Tue Jul 28 04:24:05 2009 +++ new/usr/src/cmd/ha-services/gds-agents/xvm/validate_xvm.ksh Tue Jul 28 04:24:05 2009 @@ -30,6 +30,9 @@ METHOD="validate" MACH="$(/usr/bin/uname -p)" +typeset -rx TEXTDOMAIN=SUNW_SC_XVM +typeset -rx TEXTDOMAINDIR=/opt/SUNWscxvm/lib/locale + case "${MACH}" in i386*) VM=xvm --- old/usr/src/pkgdefs/SUNW0scds/prototype_com Tue Jul 28 04:24:08 2009 +++ new/usr/src/pkgdefs/SUNW0scds/prototype_com Tue Jul 28 04:24:08 2009 @@ -200,3 +200,9 @@ d none opt/SUNWscsapwebas/webas/lib/locale 0755 root bin d none opt/SUNWscsapwebas/webas/lib/locale/C 0755 root bin d none opt/SUNWscsapwebas/webas/lib/locale/C/LC_MESSAGES 0755 root bin + +d none opt/SUNWscxvm 0755 root bin +d none opt/SUNWscxvm/lib 0755 root bin +d none opt/SUNWscxvm/lib/locale 0755 root bin +d none opt/SUNWscxvm/lib/locale/C 0755 root bin +d none opt/SUNWscxvm/lib/locale/C/LC_MESSAGES 0755 root bin --- old/usr/src/pkgdefs/SUNW0scds/prototype_i18n_i386 Tue Jul 28 04:24:10 2009 +++ new/usr/src/pkgdefs/SUNW0scds/prototype_i18n_i386 Tue Jul 28 04:24:10 2009 @@ -53,3 +53,4 @@ f none opt/SUNWscsapwebas/repl/lib/locale/C/LC_MESSAGES/SUNW_SC_SAPREPL.po 0644 root bin f none opt/SUNWscsapwebas/webas/lib/locale/C/LC_MESSAGES/SUNW_SC_SAPWEBAS.po 0644 root bin f none opt/SUNWscsapwebas/scs/lib/locale/C/LC_MESSAGES/SUNW_SC_SAPSCS.po 0644 root bin +f none opt/SUNWscxvm/lib/locale/C/LC_MESSAGES/SUNW_SC_XVM.po 0644 root bin --- old/usr/src/pkgdefs/SUNW0scds/prototype_i18n_sparc Tue Jul 28 04:24:13 2009 +++ new/usr/src/pkgdefs/SUNW0scds/prototype_i18n_sparc Tue Jul 28 04:24:12 2009 @@ -53,3 +53,4 @@ f none opt/SUNWscsapwebas/repl/lib/locale/C/LC_MESSAGES/SUNW_SC_SAPREPL.po 0644 root bin f none opt/SUNWscsapwebas/webas/lib/locale/C/LC_MESSAGES/SUNW_SC_SAPWEBAS.po 0644 root bin f none opt/SUNWscsapwebas/scs/lib/locale/C/LC_MESSAGES/SUNW_SC_SAPSCS.po 0644 root bin +f none opt/SUNWscxvm/lib/locale/C/LC_MESSAGES/SUNW_SC_XVM.po 0644 root bin