@@ -14,7 +14,6 @@ def __init__(self, common_objs, db, table):
14
14
:param table: name of the table in the db
15
15
"""
16
16
self .switch_type = ""
17
- self .chassis_tsa = ""
18
17
self .directory = common_objs ['directory' ]
19
18
self .cfg_mgr = common_objs ['cfg_mgr' ]
20
19
self .constants = common_objs ['constants' ]
@@ -55,13 +54,12 @@ def set_handler(self, key, data):
55
54
56
55
if "tsa_enabled" in data :
57
56
self .directory .put (self .db_name , self .table_name , "tsa_enabled" , data ["tsa_enabled" ])
58
-
59
- self .chassis_tsa = self .get_chassis_tsa_status ()
60
- if self .chassis_tsa == "false" and tsa_status != data ["tsa_enabled" ]:
57
+ if tsa_status != data ["tsa_enabled" ]:
61
58
self .cfg_mgr .commit ()
62
59
self .cfg_mgr .update ()
63
60
self .isolate_unisolate_device (data ["tsa_enabled" ])
64
61
62
+
65
63
if "idf_isolation_state" in data :
66
64
self .directory .put (self .db_name , self .table_name , "idf_isolation_state" , data ["idf_isolation_state" ])
67
65
if idf_isolation_state != data ["idf_isolation_state" ]:
@@ -81,9 +79,7 @@ def check_state_and_get_tsa_routemaps(self, cfg):
81
79
cmd = ""
82
80
if self .directory .path_exist ("CONFIG_DB" , swsscommon .CFG_BGP_DEVICE_GLOBAL_TABLE_NAME , "tsa_enabled" ):
83
81
tsa_status = self .directory .get_slot ("CONFIG_DB" , swsscommon .CFG_BGP_DEVICE_GLOBAL_TABLE_NAME )["tsa_enabled" ]
84
- chassis_tsa = self .get_chassis_tsa_status ()
85
-
86
- if tsa_status == "true" or chassis_tsa == "true" :
82
+ if tsa_status == "true" :
87
83
cmds = cfg .replace ("#012" , "\n " ).split ("\n " )
88
84
log_notice ("DeviceGlobalCfgMgr:: Device is isolated. Applying TSA route-maps" )
89
85
cmd = self .get_ts_routemaps (cmds , self .tsa_template )
@@ -137,17 +133,6 @@ def __extract_out_route_map_names(self, cmds):
137
133
route_map_names .add (result .group (1 ))
138
134
return route_map_names
139
135
140
- def get_chassis_tsa_status (self ):
141
- chassis_tsa_status = "false"
142
- try :
143
- ch = swsscommon .SonicV2Connector (use_unix_socket_path = False )
144
- ch .connect (ch .CHASSIS_APP_DB , False )
145
- chassis_tsa_status = ch .get (ch .CHASSIS_APP_DB , "BGP_DEVICE_GLOBAL|STATE" , 'tsa_enabled' )
146
- except Exception :
147
- pass
148
-
149
- return chassis_tsa_status
150
-
151
136
def downstream_isolate_unisolate (self , idf_isolation_state ):
152
137
cmd = "\n "
153
138
if idf_isolation_state == "unisolated" :
@@ -168,4 +153,4 @@ def check_state_and_get_idf_isolation_routemaps(self):
168
153
if idf_isolation_state != "unisolated" :
169
154
log_notice ("DeviceGlobalCfgMgr:: IDF is isolated. Applying required route-maps" )
170
155
cmd = self .idf_isolate_template .render (isolation_status = idf_isolation_state , constants = self .constants )
171
- return cmd
156
+ return cmd
0 commit comments