[Mellanox] Fix error log after warm reboot

This commit is contained in:
Junchao-Mellanox 2024-03-18 10:47:55 +02:00
parent ec57a44b47
commit e588e10bac

View File

@ -169,6 +169,7 @@ class ModulesMgmtTask(threading.Thread):
module_fd_indep_path = SYSFS_INDEPENDENT_FD_PRESENCE.format(port) 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)) logger.log_info("system in indep mode: {} port {}".format(self.is_supported_indep_mods_system, port))
if self.is_warm_reboot: if self.is_warm_reboot:
if self.is_supported_indep_mods_system:
logger.log_info("system was warm rebooted is_warm_reboot: {} trying to read control sysfs for port {}" logger.log_info("system was warm rebooted is_warm_reboot: {} trying to read control sysfs for port {}"
.format(self.is_warm_reboot, port)) .format(self.is_warm_reboot, port))
port_control_file = SYSFS_INDEPENDENT_FD_FW_CONTROL.format(port) port_control_file = SYSFS_INDEPENDENT_FD_FW_CONTROL.format(port)
@ -179,6 +180,8 @@ class ModulesMgmtTask(threading.Thread):
except Exception as e: except Exception as e:
logger.log_error("exception {} for port {} trying to read port control sysfs {}" logger.log_error("exception {} for port {} trying to read port control sysfs {}"
.format(e, port, port_control_file)) .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)) \ 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): 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)) logger.log_info("system in indep mode: {} port {} reading file {}".format(self.is_supported_indep_mods_system, port, module_fd_indep_path))