@@ -1082,38 +1082,6 @@ def update_sonic_environment():
1082
1082
display_cmd = True
1083
1083
)
1084
1084
1085
- def cache_arp_entries ():
1086
- success = True
1087
- cache_dir = '/host/config-reload'
1088
- click .echo ('Caching ARP table to {}' .format (cache_dir ))
1089
-
1090
- if not os .path .exists (cache_dir ):
1091
- os .mkdir (cache_dir )
1092
-
1093
- arp_cache_cmd = '/usr/local/bin/fast-reboot-dump.py -t {}' .format (cache_dir )
1094
- cache_proc = subprocess .Popen (arp_cache_cmd , shell = True , text = True , stdout = subprocess .PIPE )
1095
- _ , cache_err = cache_proc .communicate ()
1096
- if cache_err :
1097
- click .echo ("Could not cache ARP and FDB info prior to reloading" )
1098
- success = False
1099
-
1100
- if not cache_err :
1101
- fdb_cache_file = os .path .join (cache_dir , 'fdb.json' )
1102
- arp_cache_file = os .path .join (cache_dir , 'arp.json' )
1103
- fdb_filter_cmd = '/usr/local/bin/filter_fdb_entries -f {} -a {} -c /etc/sonic/configdb.json' .format (fdb_cache_file , arp_cache_file )
1104
- filter_proc = subprocess .Popen (fdb_filter_cmd , shell = True , text = True , stdout = subprocess .PIPE )
1105
- _ , filter_err = filter_proc .communicate ()
1106
- if filter_err :
1107
- click .echo ("Could not filter FDB entries prior to reloading" )
1108
- success = False
1109
-
1110
- # If we are able to successfully cache ARP table info, signal SWSS to restore from our cache
1111
- # by creating /host/config-reload/needs-restore
1112
- if success :
1113
- restore_flag_file = os .path .join (cache_dir , 'needs-restore' )
1114
- open (restore_flag_file , 'w' ).close ()
1115
- return success
1116
-
1117
1085
def remove_router_interface_ip_address (config_db , interface_name , ipaddress_to_remove ):
1118
1086
table_name = get_interface_table_name (interface_name )
1119
1087
keys = config_db .get_keys (table_name )
@@ -1520,12 +1488,11 @@ def list_checkpoints(ctx, verbose):
1520
1488
@click .option ('-y' , '--yes' , is_flag = True )
1521
1489
@click .option ('-l' , '--load-sysinfo' , is_flag = True , help = 'load system default information (mac, portmap etc) first.' )
1522
1490
@click .option ('-n' , '--no_service_restart' , default = False , is_flag = True , help = 'Do not restart docker services' )
1523
- @click .option ('-d' , '--disable_arp_cache' , default = False , is_flag = True , help = 'Do not cache ARP table before reloading (applies to dual ToR systems only)' )
1524
1491
@click .option ('-f' , '--force' , default = False , is_flag = True , help = 'Force config reload without system checks' )
1525
1492
@click .option ('-t' , '--file_format' , default = 'config_db' ,type = click .Choice (['config_yang' , 'config_db' ]),show_default = True ,help = 'specify the file format' )
1526
1493
@click .argument ('filename' , required = False )
1527
1494
@clicommon .pass_db
1528
- def reload (db , filename , yes , load_sysinfo , no_service_restart , disable_arp_cache , force , file_format ):
1495
+ def reload (db , filename , yes , load_sysinfo , no_service_restart , force , file_format ):
1529
1496
"""Clear current configuration and import a previous saved config DB dump file.
1530
1497
<filename> : Names of configuration file(s) to load, separated by comma with no spaces in between
1531
1498
"""
@@ -1569,13 +1536,6 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart, disable_arp_cach
1569
1536
click .echo ("Input {} config file(s) separated by comma for multiple files " .format (num_cfg_file ))
1570
1537
return
1571
1538
1572
- # For dual ToR devices, cache ARP and FDB info
1573
- localhost_metadata = db .cfgdb .get_table ('DEVICE_METADATA' )['localhost' ]
1574
- cache_arp_table = not disable_arp_cache and 'subtype' in localhost_metadata and localhost_metadata ['subtype' ].lower () == 'dualtor'
1575
-
1576
- if cache_arp_table :
1577
- cache_arp_entries ()
1578
-
1579
1539
#Stop services before config push
1580
1540
if not no_service_restart :
1581
1541
log .log_info ("'reload' stopping services..." )
0 commit comments