Skip to content

Commit 0231b49

Browse files
authored
[pcied] Fix path to pcie.yaml in pcied daemon (sonic-net#84)
Fix path to pcie.yaml in pcied daemon by calling `get_paths_to_platform_and_hwsku_dirs()` Signed-off-by: Petro Bratash <[email protected]>
1 parent 7a30ae0 commit 0231b49

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sonic-pcied/scripts/pcied

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ try:
1414

1515
import swsssdk
1616
from sonic_py_common.daemon_base import DaemonBase
17-
from sonic_py_common.device_info import get_platform
17+
from sonic_py_common import device_info
1818
except ImportError as e:
1919
raise ImportError(str(e) + " - required module not found")
2020

@@ -26,7 +26,6 @@ SYSLOG_IDENTIFIER = "pcied"
2626
PCIE_RESULT_REGEX = "PCIe Device Checking All Test"
2727
PCIE_TABLE_NAME = "PCIE_STATUS"
2828

29-
PLATFORM_ROOT_PATH = '/usr/share/sonic/device'
3029
PCIE_CONF_FILE = 'pcie.yaml'
3130

3231
PCIED_MAIN_THREAD_SLEEP_SECS = 60
@@ -41,8 +40,8 @@ class DaemonPcied(DaemonBase):
4140
def __init__(self, log_identifier):
4241
super(DaemonPcied, self).__init__(log_identifier)
4342

44-
platform = get_platform()
45-
pciefilePath = os.path.join(PLATFORM_ROOT_PATH, platform, "plugins", PCIE_CONF_FILE)
43+
(platform_path, _) = device_info.get_paths_to_platform_and_hwsku_dirs()
44+
pciefilePath = os.path.join(platform_path, "plugins", PCIE_CONF_FILE)
4645
sys.path.append(os.path.abspath(pciefilePath))
4746
if not os.path.exists(pciefilePath):
4847
self.log_error("Platform pcie configuration file doesn't exist! Exiting ...")

0 commit comments

Comments
 (0)