sonic-utilities
sonic-utilities copied to clipboard
Refresh showtech dump file modify timestamp before cleanup call
Signed-off-by: Anand Mehra [email protected]
Fixes: https://github.com/sonic-net/sonic-buildimage/issues/20693
What I did
During the show techsupport, generate_dump calls techsupport_cleanup with current generated file. The techsupport_cleanup verifies the file path provided for file last modification timestamp and on success only proceeds to cleanup. It expects the file to be modified within last 20 secs. Sometimes when file is big, gzip takes more that 20 sec. Due to this, the last modify timestamp to current time stamp diff is greater than 20 and verify_recent_file_creation fails causing cleanup to fail.
How I did it
touch the tarfile after finishing the gzip to refresh modify timestamp.
How to verify it
run show techsupport
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)
Hi @abdosi , please review or add reviewers. Thanks
Hi @qiluo-msft , please help with this PR review. Thanks
@yejianquan for cherry-pick to 202405
Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-utilities/pull/3614