From 7de9305c15ed05b5c03887862b26ab9a84a4f0e5 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Wed, 7 Sep 2022 08:26:58 -0700 Subject: [PATCH] [generate dump]Added error message when saisdkdump fails (#2356) - What I did Added error message when saisdkdump fails and cont to gather the rest. This is done to provide more readable information to the user when it cannot be avaialble (syncd for example is not running, during restart, etc). - How I did it Checked error code and print log - How to verify it Simulate saisdkdump error and verify the console output. --- scripts/generate_dump | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/generate_dump b/scripts/generate_dump index 018d884330..01ca69404a 100755 --- a/scripts/generate_dump +++ b/scripts/generate_dump @@ -885,6 +885,10 @@ collect_mellanox() { ${CMD_PREFIX}docker exec syncd mkdir -p $sai_dump_folder ${CMD_PREFIX}docker exec syncd saisdkdump -f $sai_dump_filename + if [ $? != 0 ]; then + echo "Failed to collect saisdkdump." + fi + copy_from_docker syncd $sai_dump_folder $sai_dump_folder echo "$sai_dump_folder" for file in `ls $sai_dump_folder`; do