From 427382b54ba29e90d882f8a90b975254b4207b8f Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Thu, 20 Aug 2020 17:47:04 -0700 Subject: [PATCH] [201911] Multiasic cleanup of get_npu_device_id() (#5229) * [201911] skip_thermalctld for VS platform as it is not supported root@vlab-01:/# supervisorctl status dependent-startup EXITED Aug 18 06:22 AM rsyslogd RUNNING pid 18, uptime 0:12:26 start EXITED Aug 18 06:22 AM supervisor-proc-exit-listener RUNNING pid 13, uptime 0:12:27 Signed-off-by: Abhishek Dosi * [201911] after PR #https://github.com/Azure/sonic-buildimage/pull/5204 this function is no more needed so cleaning up. Signed-off-by: Abhishek Dosi --- .../sonic_py_common/device_info.py | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/src/sonic-py-common/sonic_py_common/device_info.py b/src/sonic-py-common/sonic_py_common/device_info.py index 60fbabe56f..99f818b0f2 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -247,31 +247,6 @@ def get_npu_id_from_name(npu_name): return None -def get_npu_device_id(npu_id): - platform = get_platform() - if not platform: - return None - - asic_conf_file_path = os.path.join(SONIC_DEVICE_PATH, platform, ASIC_CONF_FILENAME) - if not os.path.isfile(asic_conf_file_path): - return None - - # In a multi-npu device we need to have the file "asic.conf" updated with the asic instance - # and the corresponding device id which could be pci_id. Below is an eg: for a 2 ASIC platform/sku. - # DEV_ID_ASIC_0=03:00.0 - # DEV_ID_ASIC_1=04:00.0 - device_str = "DEV_ID_ASIC_{}".format(npu_id) - - with open(asic_conf_file_path) as asic_conf_file: - for line in asic_conf_file: - tokens = line.split('=') - if len(tokens) < 2: - continue - if tokens[0] == device_str: - device_id = tokens[1].strip() - return device_id - - def get_namespaces(): """ In a multi NPU platform, each NPU is in a Linux Namespace.