Skip to content

Commit

Permalink
[pcied] Fix path to pcie.yaml in pcied daemon (sonic-net#84)
Browse files Browse the repository at this point in the history
Fix path to pcie.yaml in pcied daemon by calling `get_paths_to_platform_and_hwsku_dirs()`

Signed-off-by: Petro Bratash <[email protected]>
  • Loading branch information
bratashX authored Aug 12, 2020
1 parent 7a30ae0 commit 0231b49
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sonic-pcied/scripts/pcied
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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
Expand All @@ -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 ...")
Expand Down

0 comments on commit 0231b49

Please sign in to comment.