-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chassis][routecheck]filter out the chassis internal interfaces (#1798)
- Loading branch information
1 parent
4d732c6
commit 827fcee
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
from sonic_py_common import device_info | ||
|
||
def get_chassis_local_interfaces(): | ||
lst = [] | ||
platform = device_info.get_platform() | ||
chassisdb_conf=os.path.join('/usr/share/sonic/device/', platform, "chassisdb.conf") | ||
if os.path.exists(chassisdb_conf): | ||
lines=[] | ||
with open(chassisdb_conf, 'r') as f: | ||
lines = f.readlines() | ||
for line in lines: | ||
line = line.strip() | ||
if "chassis_internal_intfs" in line: | ||
data = line.split("=") | ||
lst = data[1].split(",") | ||
return lst | ||
return lst |