#!/bin/ksh93
#  ALTRAN_PROLOG_BEGIN_TAG                                                    
#  This is an automatically generated prolog.                                  
#                                                                              
#  Copyright (C) Altran ACT S.A.S. 2017,2021.  All rights reserved.  
#                                                                              
#  ALTRAN_PROLOG_END_TAG                                                      
#                                                                              

# @(#)  7d4c34b 43haes/usr/sbin/cluster/events/resource_replace.sh, 726, 2147A_aha726, Feb 05 2021 09:50 PM
#########################################################################
#
#   COMPONENT_NAME: CLMGR
#
#   FUNCTIONS:
#
#       replace_mirror_group
#       replace_repository
#
#########################################################################

#
# Name:  replace_mirror_group
#
function replace_mirror_group {
    LINENO=2 . $HALIBROOT/log_entry "$0()" "$CL" max

    typeset mirror_groups=$1

    CL=$LINENO KLIB_HACMP_replace_mirror_group "$mirror_groups"      \
                                               "${_ENV_ARGS[NODES]}" \
                                               "${_ENV_ARGS[SITES]}" \
                                               "${_ENV_ARGS[SYSTEM_GROUPS]}" \
                                               "${_ENV_ARGS[REPOSITORY_GROUP]}"
    log_return_msg "$?" "$0()" "$LINENO"
    return $?
} # End of "replace_mirror_group()"


#
# Name:  replace_repository
#
function replace_repository {
    LINENO=2 . $HALIBROOT/log_entry "$0()" "$CL" max

    typeset new_disk=$1

    CL=$LINENO KLIB_HACMP_replace_repository "$new_disk" \
                                  "${_ENV_ARGS[SITE]}" \
                                  "${_ENV_ARGS[NODE]}"
    log_return_msg "$?" "$0()" "$LINENO"
    return $?
} # End of "replace_repository()"



#########################################################################
#########################################################################
##
## MAIN
##
#########################################################################
#########################################################################

LINENO=2 . $HALIBROOT/log_entry resource_replace "$CL" max
: version=@(#)  7d4c34b 43haes/usr/sbin/cluster/events/resource_replace.sh, 726, 2147A_aha726, Feb 05 2021 09:50 PM
: INPUTS == $*

#===================================================
# Source the file with common definitions, the run
# the action/class-appropriate class processor.
#===================================================
CL=$LINENO . $HAEVENTS/resource_common "$@"
CL=$LINENO runClassProcessor "$RESOURCE_CLASS" _VAR_SUBSTITUTIONS _ENV_ARGS
log_return_msg "$?" resource_replace "$LINENO"
exit $?
