Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API to support runtime metadata needed for Feature Table field jinja rendering. #11795

Merged
merged 25 commits into from
Aug 26, 2022
Merged
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4766fcf
[submodule update] sonic-db-syncd
abdosi Apr 3, 2021
9746bb3
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 5, 2021
061821d
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 6, 2021
9e61e53
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 21, 2021
5c3a87f
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 28, 2021
5775c20
Merge remote-tracking branch 'upsteam/master'
abdosi May 14, 2021
3c20361
Merge remote-tracking branch 'upsteam/master'
abdosi May 29, 2021
cc1210d
Merge remote-tracking branch 'upsteam/master'
abdosi Aug 17, 2021
7bae398
Merge remote-tracking branch 'upsteam/master'
abdosi Sep 29, 2021
7126f88
Merge remote-tracking branch 'upsteam/master'
abdosi Oct 13, 2021
63c037c
Merge remote-tracking branch 'upsteam/master'
abdosi Nov 17, 2021
2eb13c6
Merge remote-tracking branch 'upsteam/master'
abdosi Dec 28, 2021
6f09dea
Merge remote-tracking branch 'upsteam/master'
abdosi Jan 13, 2022
cec65fc
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 1, 2022
54f0ea3
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 19, 2022
d1eeb39
Merge remote-tracking branch 'upsteam/master'
abdosi Apr 21, 2022
9a3598e
Merge remote-tracking branch 'upsteam/master'
abdosi May 2, 2022
ea7a084
Merge remote-tracking branch 'upsteam/master'
abdosi May 9, 2022
a92b47d
Merge remote-tracking branch 'upstream/master'
abdosi Jul 15, 2022
3baf0b8
Merge remote-tracking branch 'upstream/master'
abdosi Aug 11, 2022
d49e1f0
Merge remote-tracking branch 'upstream/master'
abdosi Aug 16, 2022
dad01cb
Merge remote-tracking branch 'upstream/master'
abdosi Aug 19, 2022
ca4e2ae
Added new API to return runtime metdata as needed during
abdosi Aug 19, 2022
f46e6ba
Address review Comment
abdosi Aug 25, 2022
8094cc8
Fix LGTM
abdosi Aug 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/sonic-py-common/sonic_py_common/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def is_multi_npu():

def is_voq_chassis():
switch_type = get_platform_info().get('switch_type')
return True if switch_type and switch_type == 'voq' else False
return True if switch_type and (switch_type == 'voq' or switch_type == 'fabric') else False


def is_packet_chassis():
Expand All @@ -441,7 +441,7 @@ def is_packet_chassis():


def is_chassis():
return is_voq_chassis() or is_packet_chassis()
return is_voq_chassis() or is_packet_chassis() or is_supervisor()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove is_supervisor() check here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arlakshm Done



def is_supervisor():
Expand All @@ -459,6 +459,14 @@ def is_supervisor():
return True
return False

def get_device_runtime_metadata():
chassis_metada = {}
if is_chassis():
chassis_metadata = {'CHASSIS_METADATA': {'module_type' : 'supervisor' if is_supervisor() else 'linecard',
'chassis_type': 'voq' if is_voq_chassis() else 'packet'}}

port_metadata = {'ETHERNET_PORTS_PRESENT': True if get_path_to_port_config_file(hwsku=None, asic="0" if is_multi_npu() else None) else False}
return {'DEVICE_RUNTIME_METADATA': chassis_metadata | port_metadata }

def get_npu_id_from_name(npu_name):
if npu_name.startswith(NPU_NAME_PREFIX):
Expand Down