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

[Mellanox] Fix error log after warm reboot #217

Closed
wants to merge 1 commit into from
Closed
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
23 changes: 13 additions & 10 deletions platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,19 @@ def run(self):
module_fd_indep_path = SYSFS_INDEPENDENT_FD_PRESENCE.format(port)
logger.log_info("system in indep mode: {} port {}".format(self.is_supported_indep_mods_system, port))
if self.is_warm_reboot:
logger.log_info("system was warm rebooted is_warm_reboot: {} trying to read control sysfs for port {}"
.format(self.is_warm_reboot, port))
port_control_file = SYSFS_INDEPENDENT_FD_FW_CONTROL.format(port)
try:
port_control = utils.read_int_from_file(port_control_file, raise_exception=True)
self.port_control_dict[port] = port_control
logger.log_info(f"port control sysfs is {port_control} for port {port}")
except Exception as e:
logger.log_error("exception {} for port {} trying to read port control sysfs {}"
.format(e, port, port_control_file))
if self.is_supported_indep_mods_system:
logger.log_info("system was warm rebooted is_warm_reboot: {} trying to read control sysfs for port {}"
.format(self.is_warm_reboot, port))
port_control_file = SYSFS_INDEPENDENT_FD_FW_CONTROL.format(port)
try:
port_control = utils.read_int_from_file(port_control_file, raise_exception=True)
self.port_control_dict[port] = port_control
logger.log_info(f"port control sysfs is {port_control} for port {port}")
except Exception as e:
logger.log_error("exception {} for port {} trying to read port control sysfs {}"
.format(e, port, port_control_file))
else:
self.port_control_dict[port] = 0
if (self.is_supported_indep_mods_system and os.path.isfile(module_fd_indep_path)) \
and not (self.is_warm_reboot and 0 == port_control):
logger.log_info("system in indep mode: {} port {} reading file {}".format(self.is_supported_indep_mods_system, port, module_fd_indep_path))
Expand Down