Skip to content

Commit

Permalink
Fix review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Junchao-Mellanox committed Apr 4, 2023
1 parent 75ddd2b commit 5c553e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/system-health/health_checker/hardware_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ def _check_fan_status(self, config):
if direction != 'N/A':
if not expect_fan_direction:
# initialize the expect fan direction
expect_fan_direction = direction
elif direction != expect_fan_direction:
expect_fan_direction = (name, direction)
elif direction != expect_fan_direction[1]:
self.set_object_not_ok('Fan', name,
f'{name} direction is not aligned, previous:{expect_fan_direction}, current:{direction}')
f'{name} direction {direction} is not aligned with {expect_fan_direction[0]} direction {expect_fan_direction[1]}')
continue

status = data_dict.get('status', 'false')
Expand Down
2 changes: 1 addition & 1 deletion src/system-health/tests/test_system_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def test_hardware_checker():

assert 'fan5' in checker._info
assert checker._info['fan5'][HealthChecker.INFO_FIELD_OBJECT_STATUS] == HealthChecker.STATUS_NOT_OK
assert checker._info['fan5'][HealthChecker.INFO_FIELD_OBJECT_MSG] == 'fan5 direction is not aligned, previous:intake, current:exhaust'
assert checker._info['fan5'][HealthChecker.INFO_FIELD_OBJECT_MSG] == 'fan5 direction exhaust is not aligned with fan1 direction intake'

assert 'PSU 1' in checker._info
assert checker._info['PSU 1'][HealthChecker.INFO_FIELD_OBJECT_STATUS] == HealthChecker.STATUS_OK
Expand Down

0 comments on commit 5c553e2

Please sign in to comment.