From 3eb7e6467e96256ddb0b2ee427c116acb7115ef7 Mon Sep 17 00:00:00 2001 From: Michel Thebeau Date: Wed, 9 Aug 2023 13:50:07 -0400 Subject: [PATCH] libvirt: include worker nodes in duplex configuration Duplex configuration may include worker nodes, as described in "Deployment Configurations" page of Starlingx docs. Allow the setup_configuration.sh and destroy_configuration.sh to include worker nodes. Test Plan: PASS setup/destroy configurations Story: 2010816 Task: 49219 Change-Id: I276002255f42ca68228d179777e717fc84ea2e9a Signed-off-by: Michel Thebeau --- libvirt/destroy_configuration.sh | 3 ++- libvirt/setup_configuration.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libvirt/destroy_configuration.sh b/libvirt/destroy_configuration.sh index 9b489ad..8444dc4 100755 --- a/libvirt/destroy_configuration.sh +++ b/libvirt/destroy_configuration.sh @@ -34,7 +34,8 @@ fi configuration_check ${CONFIGURATION} destroy_controller ${CONFIGURATION} ${CONTROLLER} -if ([ "$CONFIGURATION" == "controllerstorage" ] || [ "$CONFIGURATION" == "dedicatedstorage" ]); then +WORK_CFGS="duplex controllerstorage dedicatedstorage" +if [[ " $WORK_CFGS " == *" $CONFIGURATION "* ]]; then for ((i=0; i<=$WORKER_NODES_NUMBER; i++)); do destroy_node "worker" ${i} ${CONFIGURATION} done diff --git a/libvirt/setup_configuration.sh b/libvirt/setup_configuration.sh index 632188e..5a7cfd4 100755 --- a/libvirt/setup_configuration.sh +++ b/libvirt/setup_configuration.sh @@ -45,7 +45,8 @@ if [ $? -ne 0 ]; then exit 1 fi -if ([ "$CONFIGURATION" == "controllerstorage" ] || [ "$CONFIGURATION" == "dedicatedstorage" ]); then +WORK_CFGS="duplex controllerstorage dedicatedstorage" +if [[ " $WORK_CFGS " == *" $CONFIGURATION "* ]]; then for ((i=0; i<=$WORKER_NODES_NUMBER; i++)); do create_node "worker" ${i} ${CONFIGURATION} ${BRIDGE_INTERFACE} if [ $? -ne 0 ]; then