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

[pcied] Fix pcied failure to load due to 'pcied NameError: name 'self' is not defined' #198

Merged
merged 1 commit into from
Jul 13, 2021
Merged
Changes from all commits
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
8 changes: 5 additions & 3 deletions sonic-pcied/scripts/pcied
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import signal
import sys
import threading

from sonic_py_common import daemon_base, device_info
from sonic_py_common import daemon_base, device_info, logger
from swsscommon import swsscommon

#
Expand All @@ -35,6 +35,8 @@ PCIEUTIL_LOAD_ERROR = 2

platform_pcieutil = None

log = logger.Logger(SYSLOG_IDENTIFIER)

exit_code = 0

# wrapper functions to call the platform api
Expand All @@ -45,12 +47,12 @@ def load_platform_pcieutil():
from sonic_platform.pcie import Pcie
_platform_pcieutil = Pcie(platform_path)
except ImportError as e:
self.log_error("Failed to load platform Pcie module. Error : {}".format(str(e)), True)
log.log_notice("Failed to load platform Pcie module. Error : {}, Fallback to default module".format(str(e)), True)
try:
from sonic_platform_base.sonic_pcie.pcie_common import PcieUtil
_platform_pcieutil = PcieUtil(platform_path)
except ImportError as e:
self.log_error("Failed to load default PcieUtil module. Error : {}".format(str(e)), True)
log.log_error("Failed to load default PcieUtil module. Error : {}".format(str(e)), True)
return _platform_pcieutil

def read_id_file(device_name):
Expand Down