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.
This commit is contained in:
abdosi 2022-08-31 10:48:15 -07:00 committed by GitHub
parent 1e75abc274
commit 4027147238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -476,7 +476,10 @@ def get_device_runtime_metadata():
'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 }
runtime_metadata = {}
runtime_metadata.update(chassis_metadata)
runtime_metadata.update(port_metadata)
return {'DEVICE_RUNTIME_METADATA': runtime_metadata }
def get_npu_id_from_name(npu_name):
if npu_name.startswith(NPU_NAME_PREFIX):