File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 47
47
import traceback
48
48
49
49
from swsscommon import swsscommon
50
+ from utilities_common import chassis
50
51
51
52
APPL_DB_NAME = 'APPL_DB'
52
53
ASIC_DB_NAME = 'ASIC_DB'
@@ -348,6 +349,9 @@ def filter_out_local_interfaces(keys):
348
349
local_if_lst = {'eth0' , 'docker0' }
349
350
local_if_lo = [r'tun0' , r'lo' , r'Loopback\d+' ]
350
351
352
+ chassis_local_intfs = chassis .get_chassis_local_interfaces ()
353
+ local_if_lst .update (set (chassis_local_intfs ))
354
+
351
355
db = swsscommon .DBConnector (APPL_DB_NAME , 0 )
352
356
tbl = swsscommon .Table (db , 'ROUTE_TABLE' )
353
357
Original file line number Diff line number Diff line change
1
+ import os
2
+ from sonic_py_common import device_info
3
+
4
+ def get_chassis_local_interfaces ():
5
+ lst = []
6
+ platform = device_info .get_platform ()
7
+ chassisdb_conf = os .path .join ('/usr/share/sonic/device/' , platform , "chassisdb.conf" )
8
+ if os .path .exists (chassisdb_conf ):
9
+ lines = []
10
+ with open (chassisdb_conf , 'r' ) as f :
11
+ lines = f .readlines ()
12
+ for line in lines :
13
+ line = line .strip ()
14
+ if "chassis_internal_intfs" in line :
15
+ data = line .split ("=" )
16
+ lst = data [1 ].split ("," )
17
+ return lst
18
+ return lst
You can’t perform that action at this time.
0 commit comments