Skip to content

Commit d2a5dcf

Browse files
abdosizbud-msft
authored andcommitted
Align API get_device_runtime_metadata() for python version < 3.9 (#11900)
Why I did it: API get_device_runtime_metadata() added by #11795 uses merge operator for dict but that is supported only for python version >=3.9. This API will be be used by scrips eg:hostcfgd which is still build for buster which does not have python 3.9 support.
1 parent 12c8db0 commit d2a5dcf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sonic-py-common/sonic_py_common/device_info.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,10 @@ def get_device_runtime_metadata():
476476
'chassis_type': 'voq' if is_voq_chassis() else 'packet'}}
477477

478478
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}
479-
return {'DEVICE_RUNTIME_METADATA': chassis_metadata | port_metadata }
479+
runtime_metadata = {}
480+
runtime_metadata.update(chassis_metadata)
481+
runtime_metadata.update(port_metadata)
482+
return {'DEVICE_RUNTIME_METADATA': runtime_metadata }
480483

481484
def get_npu_id_from_name(npu_name):
482485
if npu_name.startswith(NPU_NAME_PREFIX):

0 commit comments

Comments
 (0)