Print this page
6865006 ldom validate shouldn't check for password file if migration type is set to normal
6864993 HA-xVM validate messages need to be wrapped by gettext

@@ -72,16 +72,21 @@
       
            shift $((${OPTIND} - 1))
            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()
 {
         typeset DEBUG_TEXT=

@@ -212,10 +217,11 @@
 {
         debug_message "Function: validate_xvm - Begin"
         ${SET_DEBUG}
 
         typeset rc=0
+        typeset msgtext
    
         if [ "$(/usr/bin/uname -i)" != "i86xpv" ]
         then
            # SCMSGS
            # @explanation

@@ -224,10 +230,13 @@
            # Ensure that the default boot grub menu is set to boot
            # Solaris xVM.
            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
 
         debug_message "Function: validate_xvm - End"
 

@@ -238,26 +247,50 @@
 {
         debug_message "Function: validate_ldom - Begin"
         ${SET_DEBUG}
 
         typeset ncount=0
+        typeset msgtext
 
         # Make sure that the password file is readable.
-        if [ ! -r "${PASSWORD_FILE}" ]
+        if [[ ${MIGRATION_TYPE} != "NORMAL" ]]
         then
+           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)."
+
+              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.
         if ! ${LDM} ls > /dev/null 2>&1
         then
            # SCMSGS

@@ -267,10 +300,13 @@
            # Ensure that the resource is configured in
            # control domain.
            scds_syslog -p daemon.error -t $(syslog_tag) -m \
                "The LDom Manager is running in configuration mode."
 
+           msgtext=$(gettext "The LDom Manager is running in configuration mode.")
+           i18n_message "${msgtext}"
+
               debug_message "Function: validate_ldom - End"
            return 1
         fi
 
         # Ensure that the failure-policy setting is set to "reset".

@@ -289,10 +325,13 @@
            # set to "reset" on the control domain.
            scds_syslog -p daemon.error -t $(syslog_tag) -m \
               "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
 
         # The CL_EXEC_CLIENT program executes a command on any of the 

@@ -317,11 +356,10 @@
            fi
 
            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 ))
            then
               domstate=$(echo $output | ${AWK} -F" " '{print $18}')     

@@ -335,10 +373,13 @@
                  # Ensure that the domain is in inactive or bound state.
                  scds_syslog -p daemon.error -t $(syslog_tag) -m \
                     "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
 
               ncount=$((ncount+1))

@@ -361,10 +402,14 @@
            if ! ${CCRADM} showkey --key xml_${RESOURCE} ${CCR_TABLE} > /dev/null 2>&1
            then
               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
 
         if [[ ${ncount} -gt 1 ]]

@@ -377,10 +422,14 @@
            # Ensure that the domain is configured on one node
            # of the cluster.
            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
 
         debug_message "Function: validate_ldom - End"
         return 0

@@ -405,10 +454,13 @@
                # Ensure that a valid user probe file is specified.
                scds_syslog -p daemon.error -t $(syslog_tag) -m \
                    "Invalid user probe file %s." \
                    "${PLUGIN_PROBE}"
 
+               msgtext=$(gettext "Invalid user probe file %s.")
+               i18n_message "${msgtext}" "${PLUGIN_PROBE}"
+
                return 1
            fi
         fi
    
         validate_${VM}