Skip to content

Commit

Permalink
update testbed-cli.sh
Browse files Browse the repository at this point in the history
1. remove dut with dpu string, otherwise when add topo, we don't need to add topo for dpu
2. remove space for duts, otherwise it when using echo to create fail will fail
  • Loading branch information
JibinBao committed Dec 13, 2024
1 parent 92e1a77 commit c0dca36
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ansible/testbed-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ function read_yaml
dut=${line_arr[11]}
duts=$(python -c "from __future__ import print_function; print(','.join(eval(\"$dut\")))")
inv_name=${line_arr[12]}
# Remove the dpu duts by the keyword 'dpu' in the dut name
duts=$(echo $duts | sed "s/,[^,]*dpu[^,]*//g")
}

function read_file
Expand Down Expand Up @@ -283,7 +285,7 @@ function add_topo

cache_files_path_value=$(is_cache_exist)
if [[ -n $cache_files_path_value ]]; then
echo "$testbed_name" > $cache_files_path_value/$dut
echo "$testbed_name" > $cache_files_path_value/$duts
fi

echo Done
Expand Down Expand Up @@ -694,7 +696,7 @@ function deploy_topo_with_cache
fi

read_file ${testbed_name}
setup_name=$dut
setup_name=$duts
if [[ "$setup_name" == "" ]]; then
echo "No such testbed: $testbed_name, exiting..."
exit
Expand Down

0 comments on commit c0dca36

Please sign in to comment.