Skip to content

Commit

Permalink
Removed -t option and other missing fixes (sonic-net#1884)
Browse files Browse the repository at this point in the history
- What I did
This PR include some fixes which were missed for sonic-net#1723
i.e. removing -t option from the docker exec commands. to understand why the -it option was removed, refer sonic-net#1723.
Also, the show techsupport exits with $RETURN_CODE only when --redirect-stderr option is used.

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
  • Loading branch information
vivekrnv authored Nov 10, 2021
1 parent 63a5257 commit 50bbfa0
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,11 @@ save_redis() {
save_saidump() {
trap 'handle_error $? $LINENO' ERR
if [[ ( "$NUM_ASICS" == 1 ) ]] ; then
save_cmd "docker exec -t syncd saidump" "saidump"
save_cmd "docker exec syncd saidump" "saidump"
else
for (( i=0; i<$NUM_ASICS; i++ ))
do
save_cmd "docker exec -t syncd$i saidump" "saidump$i"
save_cmd "docker exec syncd$i saidump" "saidump$i"
done
fi
}
Expand Down Expand Up @@ -830,8 +830,8 @@ collect_mellanox() {
local sai_dump_folder="/tmp/saisdkdump"
local sai_dump_filename="${sai_dump_folder}/sai_sdk_dump_$(date +"%m_%d_%Y_%I_%M_%p")"

${CMD_PREFIX}docker exec -t syncd mkdir -p $sai_dump_folder
${CMD_PREFIX}docker exec -t syncd saisdkdump -f $sai_dump_filename
${CMD_PREFIX}docker exec syncd mkdir -p $sai_dump_folder
${CMD_PREFIX}docker exec syncd saisdkdump -f $sai_dump_filename

copy_from_docker syncd $sai_dump_folder $sai_dump_folder
echo "$sai_dump_folder"
Expand All @@ -840,7 +840,7 @@ collect_mellanox() {
done

${CMD_PREFIX}rm -rf $sai_dump_folder
${CMD_PREFIX}docker exec -t syncd rm -rf $sai_dump_folder
${CMD_PREFIX}docker exec syncd rm -rf $sai_dump_folder

# Save SDK error dumps
local sdk_dump_path=`${CMD_PREFIX}docker exec syncd cat /tmp/sai.profile|grep "SAI_DUMP_STORE_PATH"|cut -d = -f2`
Expand Down Expand Up @@ -1217,12 +1217,12 @@ main() {
if [[ ( "$NUM_ASICS" > 1 ) ]]; then
for (( i=0; i<$NUM_ASICS; i++ ))
do
save_cmd "docker exec -t lldp$i lldpcli show statistics" "lldp$i.statistics"
save_cmd "docker exec lldp$i lldpcli show statistics" "lldp$i.statistics"
save_cmd "docker logs bgp$i" "docker.bgp$i.log"
save_cmd "docker logs swss$i" "docker.swss$i.log"
done
else
save_cmd "docker exec -t lldp lldpcli show statistics" "lldp.statistics"
save_cmd "docker exec lldp lldpcli show statistics" "lldp.statistics"
save_cmd "docker logs bgp" "docker.bgp.log"
save_cmd "docker logs swss" "docker.swss.log"
fi
Expand Down Expand Up @@ -1339,7 +1339,11 @@ main() {
fi

echo ${TARFILE}
exit $RETURN_CODE

if ! $SAVE_STDERR
then
exit $RETURN_CODE
fi
}

###############################################################################
Expand Down

0 comments on commit 50bbfa0

Please sign in to comment.