Skip to content

Commit

Permalink
[warm-reboot] fix warm-reboot when /tmp/cache is missing (#2367)
Browse files Browse the repository at this point in the history
- What I did
Fixed issue when cache wasn't generated and warm reboot command fails.
Fixes sonic-net/sonic-buildimage#11914

- How I did it
Added a check for cache existence

- How to verify it
Run warm-reboot

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
  • Loading branch information
stepanblyschak authored and yxieca committed Mar 24, 2023
1 parent 3293866 commit 93f1d74
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,13 @@ function save_counters_folder() {
if [[ "$REBOOT_TYPE" = "warm-reboot" ]]; then
debug "Saving counters folder before warmboot..."
counters_folder="/host/counters"
counters_cache="/tmp/cache"
if [[ ! -d $counters_folder ]]; then
mkdir $counters_folder
fi
cp -rf /tmp/cache $counters_folder
if [[ -d $counters_cache ]]; then
cp -rf $counters_cache $counters_folder
fi
fi
}
Expand Down

0 comments on commit 93f1d74

Please sign in to comment.