Skip to content

Commit

Permalink
Fix naming issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gpunathilell committed Jun 24, 2024
1 parent f1df1a4 commit a7e3817
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 370 deletions.
160 changes: 0 additions & 160 deletions platform/mellanox/mlnx-platform-api/sonic_platform/dpuctl_hwm.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def dpu_go_down(self):
self.write_file(self.set_go_down_path, "1")
try:
get_shtdn_inotify = InotifyHelper(self.get_shtdn_ready_path)
dpu_shtdn_rdy = get_shtdn_inotify.add_watch(WAIT_FOR_SHTDN, 1)
dpu_shtdn_rdy = get_shtdn_inotify.wait_watch(WAIT_FOR_SHTDN, 1)
except (FileNotFoundError, PermissionError) as inotify_exc:
raise type(inotify_exc)(f"{self.get_name()}:{str(inotify_exc)}")
if not dpu_shtdn_rdy:
Expand All @@ -101,7 +101,7 @@ def _power_on_force(self, count=4):
logger.log_info(f"{self.get_name()}: Failed Force Power on! Retry {4-count}..")
self.write_file(self.set_pwr_f_path, "0")
get_rdy_inotify = InotifyHelper(self.get_dpu_rdy_path)
dpu_rdy = get_rdy_inotify.add_watch(WAIT_FOR_DPU_READY, 1)
dpu_rdy = get_rdy_inotify.wait_watch(WAIT_FOR_DPU_READY, 1)
if not dpu_rdy:
if count > 1:
time.sleep(1)
Expand All @@ -115,7 +115,7 @@ def _power_on(self):
"""Per DPU Power on without force private function"""
self.write_file(self.set_pwr_path, "0")
get_rdy_inotify = InotifyHelper(self.get_dpu_rdy_path)
dpu_rdy = get_rdy_inotify.add_watch(WAIT_FOR_DPU_READY, 1)
dpu_rdy = get_rdy_inotify.wait_watch(WAIT_FOR_DPU_READY, 1)
if not dpu_rdy:
logger.log_error(f"{self.get_name()}: Failed power on! Trying Force Power on")
return self._power_on_force()
Expand All @@ -137,7 +137,7 @@ def dpu_reboot(self):
self.dpu_power_off(forced=True)
self.write_file(self.set_go_down_path, "0")
get_rdy_inotify = InotifyHelper(self.get_dpu_rdy_path)
dpu_rdy = get_rdy_inotify.add_watch(WAIT_FOR_DPU_READY, 1)
dpu_rdy = get_rdy_inotify.wait_watch(WAIT_FOR_DPU_READY, 1)
if not dpu_rdy:
return self.dpu_power_on(forced=True)
logger.log_info(f"{self.get_name()}: Reboot complete")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, file_path):
os.strerror(errno.ENOENT),
self.file_path)

def add_watch(self, timeout, expected_value):
def wait_watch(self, timeout, expected_value):
"""Waits for changes in file until specified time and
compares written value to expected value"""
self.inotify_obj.add_watch(self.file_path,
Expand Down
Loading

0 comments on commit a7e3817

Please sign in to comment.