@@ -1322,6 +1322,18 @@ def flush_configdb(namespace=DEFAULT_NAMESPACE):
1322
1322
return client , config_db
1323
1323
1324
1324
1325
+ def delete_transceiver_tables ():
1326
+ tables = ["TRANSCEIVER_INFO" , "TRANSCEIVER_STATUS" , "TRANSCEIVER_PM" ,
1327
+ "TRANSCEIVER_FIRMWARE_INFO" , "TRANSCEIVER_DOM_SENSOR" , "TRANSCEIVER_DOM_THRESHOLD" ]
1328
+ state_db_del_pattern = "|*"
1329
+
1330
+ # delete TRANSCEIVER tables from State DB
1331
+ state_db = SonicV2Connector (use_unix_socket_path = True )
1332
+ state_db .connect (state_db .STATE_DB , False )
1333
+ for table in tables :
1334
+ state_db .delete_all_by_pattern (state_db .STATE_DB , table + state_db_del_pattern )
1335
+
1336
+
1325
1337
def migrate_db_to_lastest (namespace = DEFAULT_NAMESPACE ):
1326
1338
# Migrate DB contents to latest version
1327
1339
db_migrator = '/usr/local/bin/db_migrator.py'
@@ -1905,6 +1917,7 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart, force, file_form
1905
1917
cfg_hwsku = output .strip ()
1906
1918
1907
1919
client , config_db = flush_configdb (namespace )
1920
+ delete_transceiver_tables ()
1908
1921
1909
1922
if load_sysinfo :
1910
1923
if namespace is DEFAULT_NAMESPACE :
@@ -2037,6 +2050,7 @@ def load_minigraph(db, no_service_restart, traffic_shift_away, override_config,
2037
2050
# Stop services before config push
2038
2051
if not no_service_restart :
2039
2052
log .log_notice ("'load_minigraph' stopping services..." )
2053
+ delete_transceiver_tables ()
2040
2054
_stop_services ()
2041
2055
2042
2056
# For Single Asic platform the namespace list has the empty string
0 commit comments