Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pcieutil to load the platform api first instead of using common api #1672

Merged
merged 2 commits into from
Jun 28, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions pcieutil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,18 @@ def load_platform_pcieutil():
global platform_path

# Load platform module from source
platform_path, _ = device_info.get_paths_to_platform_and_hwsku_dirs()
try:
platform_path, _ = device_info.get_paths_to_platform_and_hwsku_dirs()
from sonic_platform_base.sonic_pcie.pcie_common import PcieUtil
platform_pcieutil = PcieUtil(platform_path)
from sonic_platform.pcie import Pcie
platform_pcieutil = Pcie(platform_path)
except ImportError as e:
log.log_error("Failed to load default PcieUtil module. Error : {}".format(str(e)), True)
raise e
self.log_error("Failed to load platform Pcie module. Error : {}".format(str(e)), True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change self to log

Suggested change
self.log_error("Failed to load platform Pcie module. Error : {}".format(str(e)), True)
log.log_error("Failed to load platform Pcie module. Error : {}".format(str(e)), True)

try:
from sonic_platform_base.sonic_pcie.pcie_common import PcieUtil
platform_pcieutil = PcieUtil(platform_path)
except ImportError as e:
log.log_error("Failed to load default PcieUtil module. Error : {}".format(str(e)), True)
raise e


# ==================== CLI commands and groups ====================
Expand Down