From 0231b49ae84cf18c3a8d0c855215c467f28d48d3 Mon Sep 17 00:00:00 2001 From: Petro Bratash <68950226+bratashX@users.noreply.github.com> Date: Wed, 12 Aug 2020 07:37:51 +0300 Subject: [PATCH] [pcied] Fix path to pcie.yaml in pcied daemon (#84) Fix path to pcie.yaml in pcied daemon by calling `get_paths_to_platform_and_hwsku_dirs()` Signed-off-by: Petro Bratash --- sonic-pcied/scripts/pcied | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sonic-pcied/scripts/pcied b/sonic-pcied/scripts/pcied index fd986f984390..47b7a496e7e0 100644 --- a/sonic-pcied/scripts/pcied +++ b/sonic-pcied/scripts/pcied @@ -14,7 +14,7 @@ try: import swsssdk from sonic_py_common.daemon_base import DaemonBase - from sonic_py_common.device_info import get_platform + from sonic_py_common import device_info except ImportError as e: raise ImportError(str(e) + " - required module not found") @@ -26,7 +26,6 @@ SYSLOG_IDENTIFIER = "pcied" PCIE_RESULT_REGEX = "PCIe Device Checking All Test" PCIE_TABLE_NAME = "PCIE_STATUS" -PLATFORM_ROOT_PATH = '/usr/share/sonic/device' PCIE_CONF_FILE = 'pcie.yaml' PCIED_MAIN_THREAD_SLEEP_SECS = 60 @@ -41,8 +40,8 @@ class DaemonPcied(DaemonBase): def __init__(self, log_identifier): super(DaemonPcied, self).__init__(log_identifier) - platform = get_platform() - pciefilePath = os.path.join(PLATFORM_ROOT_PATH, platform, "plugins", PCIE_CONF_FILE) + (platform_path, _) = device_info.get_paths_to_platform_and_hwsku_dirs() + pciefilePath = os.path.join(platform_path, "plugins", PCIE_CONF_FILE) sys.path.append(os.path.abspath(pciefilePath)) if not os.path.exists(pciefilePath): self.log_error("Platform pcie configuration file doesn't exist! Exiting ...")