Skip to content

Commit 6b25da9

Browse files
committed
move seek to beginnig of sysfs fd before reading to resolve power_good
sysfs returns empty upon plug out cable
1 parent 6e02273 commit 6b25da9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ def run(self):
279279
module_fd_path = module_obj.module_power_good_fd_path
280280
self.fds_events_count_dict[module_obj.port_num][fd_name] += 1
281281
try:
282-
val = module_fd.read()
283282
module_fd.seek(0)
283+
val = module_fd.read()
284284
logger.log_info("dynamic detection got module_obj {} with port {} from fd number {} path {} val {} count {}"
285285
.format(module_obj, module_obj.port_num, fd, module_fd_path
286286
, val, self.fds_events_count_dict[module_obj.port_num]))

0 commit comments

Comments
 (0)