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 Sep 19, 2022
1 parent a3c404c commit 09026ed
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 @@ -466,10 +466,13 @@ function save_counters_folder() {
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 09026ed

Please sign in to comment.