Skip to content

Commit

Permalink
reorganize component dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
yxieca committed Jan 14, 2021
1 parent 20407c7 commit 9baf54a
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions files/image_config/warmboot-finalizer/finalize-warmboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ VERBOSE=no

# Define components that needs to reconcile during warm
# boot:
# The key would be the component name that would
# reconcile.
# The value is the name of the service that the
# component belongs to.
# The key is the name of the service that the components belong to.
# The value is list of component names that will reconcile.
declare -A RECONCILE_COMPONENTS=( \
["orchagent"]="swss" \
["neighsyncd"]="swss" \
["bgp"]="bgp" \
["natsyncd"]="nat" \
["swss"]="orchagent neighsyncd" \
["bgp"]="bgp" \
["nat"]="natsyncd" \
)
EXP_STATE="reconciled"

Expand All @@ -30,13 +27,13 @@ function debug()

function get_component_list()
{
CP_LIST=${!RECONCILE_COMPONENTS[@]}
SVC_LIST=${!RECONCILE_COMPONENTS[@]}
COMPONENT_LIST=""
for cp in ${CP_LIST}; do
service=${RECONCILE_COMPONENTS[${cp}]}
for service in ${SVC_LIST}; do
components=${RECONCILE_COMPONENTS[${service}]}
status=$(sonic-db-cli CONFIG_DB HGET "FEATURE|${service}" state)
if [[ x"${status}" == x"enabled" || x"${status}" == x"always_enabled" ]]; then
COMPONENT_LIST="${COMPONENT_LIST} ${cp}"
COMPONENT_LIST="${COMPONENT_LIST} ${components}"
fi
done
}
Expand Down

0 comments on commit 9baf54a

Please sign in to comment.