Skip to content

Commit

Permalink
[updategraph] After system upgrade, restore files/directories with
Browse files Browse the repository at this point in the history
original attributes etc.
Restore a few more files that was missed before.
Restore FRR configuration directory if exists on old system

Signed-off-by: Zhenggen Xu <[email protected]>
  • Loading branch information
zhenggen-xu committed Jan 26, 2019
1 parent 35a0d69 commit 09e2e54
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions files/image_config/updategraph/updategraph
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ reload_minigraph()
pfcwd start_default
}

function copy_config_files()
function copy_config_files_and_directories()
{
for file in $@; do
if [ -f /etc/sonic/old_config/${file} ]; then
logger "Copying SONiC configuration ${file} ..."
cp /etc/sonic/old_config/${file} /etc/sonic/
for file_dir in $@; do
if [ -f /etc/sonic/old_config/${file_dir} ] || [ -d /etc/sonic/old_config/${file_dir} ]; then
logger "Copying SONiC configuration ${file_dir} ..."
cp -ar /etc/sonic/old_config/${file_dir} /etc/sonic/
else
logger "Missing SONiC configuration ${file} ..."
logger "Missing SONiC configuration ${file_dir} ..."
fi
done
}
Expand All @@ -50,9 +50,9 @@ fi
. /etc/sonic/updategraph.conf

check_system_warm_boot

copy_list="minigraph.xml snmp.yml acl.json config_db.json deployment_id_asn_map.yml frr"
if [ -f /tmp/pending_config_migration ]; then
copy_config_files minigraph.xml snmp.yml acl.json config_db.json
copy_config_files_and_directories $copy_list
if [ x"${WARM_BOOT}" == x"true" ]; then
echo "Warm reboot detected..."
elif [ "$enabled" = "true" ]; then
Expand Down

0 comments on commit 09e2e54

Please sign in to comment.