Skip to content

Commit 48035d7

Browse files
authored
[202012] [techsupport] Techsupport Error Reporting pending fixes (sonic-net#1854)
#### What I did This PR include some fixes which were missed while manually porting the error reporting PR onto 202012 sonic-net#1833. i.e. removing -it option from the docker exec commands. to understand why the -it option was removed, refer sonic-net#1723 This also include another fix which removes -d from the show ip interface command, which fails otherwise. **Note:** -d option for "show ip interface" is working on master and 202106. and not for 202012. So, this change is particular to 202012. Master: ``` admin@sonic-master-imge:~$ show ip interfaces -d all Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP --------------- -------- ------------------- ------------ -------------- ------------- Loopback0 10.1.0.32/32 up/up N/A N/A PortChannel0001 10.0.0.56/31 up/up ARISTA01T1 10.0.0.57 PortChannel0002 10.0.0.58/31 up/up ARISTA02T1 10.0.0.59 PortChannel0003 10.0.0.60/31 up/up ARISTA03T1 10.0.0.61 PortChannel0004 10.0.0.62/31 up/up ARISTA04T1 10.0.0.63 Vlan1000 192.168.0.1/21 up/up N/A N/A docker0 240.127.1.1/24 up/down N/A N/A eth0 10.75.206.180/24 up/up N/A N/A lo 127.0.0.1/16 up/up N/A N/A ``` 202012: ``` admin@sonic-202012-image:~$ show ip interfaces -d all Usage: show ip interfaces [OPTIONS] Try "show ip interfaces -h" for help. Error: no such option: -d ``` #### How I did it #### How to verify it - Run the show tech-support and check the return status. It should be zero. (Atleast, it was on mellanox platform. I couldn't check the functions which were platform specific) - Run the "show techsupport" test.
1 parent 8b2ec09 commit 48035d7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

scripts/generate_dump

+9-5
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,11 @@ save_redis() {
664664
save_saidump() {
665665
trap 'handle_error $? $LINENO' ERR
666666
if [[ ( "$NUM_ASICS" == 1 ) ]] ; then
667-
save_cmd "docker exec -it syncd saidump" "saidump"
667+
save_cmd "docker exec syncd saidump" "saidump"
668668
else
669669
for (( i=0; i<$NUM_ASICS; i++ ))
670670
do
671-
save_cmd "docker exec -it syncd$i saidump" "saidump$i"
671+
save_cmd "docker exec syncd$i saidump" "saidump$i"
672672
done
673673
fi
674674
}
@@ -807,7 +807,7 @@ enable_logrotate() {
807807
collect_mellanox() {
808808
trap 'handle_error $? $LINENO' ERR
809809
local sai_dump_filename="/tmp/sai_sdk_dump_$(date +"%m_%d_%Y_%I_%M_%p")"
810-
${CMD_PREFIX}docker exec -it syncd saisdkdump -f $sai_dump_filename
810+
${CMD_PREFIX}docker exec syncd saisdkdump -f $sai_dump_filename
811811
${CMD_PREFIX}docker exec syncd tar Ccf $(dirname $sai_dump_filename) - $(basename $sai_dump_filename) | tar Cxf /tmp/ -
812812
save_file $sai_dump_filename sai_sdk_dump true
813813

@@ -1161,7 +1161,7 @@ main() {
11611161
save_cmd "show interface status -d all" "interface.status"
11621162
save_cmd "show interface transceiver presence" "interface.xcvrs.presence"
11631163
save_cmd "show interface transceiver eeprom --dom" "interface.xcvrs.eeprom"
1164-
save_cmd "show ip interface -d all" "ip.interface"
1164+
save_cmd "show ip interface" "ip.interface"
11651165

11661166
save_cmd "lldpctl" "lldpctl"
11671167
if [[ ( "$NUM_ASICS" > 1 ) ]]; then
@@ -1266,7 +1266,11 @@ main() {
12661266
fi
12671267

12681268
echo ${TARFILE}
1269-
exit $RETURN_CODE
1269+
1270+
if ! $SAVE_STDERR
1271+
then
1272+
exit $RETURN_CODE
1273+
fi
12701274
}
12711275

12721276
###############################################################################

0 commit comments

Comments
 (0)