Skip to content

Commit 7cbae20

Browse files
committed
correct supervisord format and is_leak return value when sysfs doesn't
exist at all Signed-off-by: Yuanzhe, Liu <[email protected]>
1 parent 156eab0 commit 7cbae20

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ dependent_startup_wait_for=rsyslogd:running {% if delay_non_critical_daemon %}de
207207
{% endif -%}
208208

209209
{% if liquid_cooling_update_interval %}
210-
{%- set options = options + " --liquid_cooling_update_interval {{ liquid_cooling_update_interval }}" %}
210+
{%- set options = options ~ " --liquid_cooling_update_interval " ~ liquid_cooling_update_interval %}
211211
{% endif -%}
212212

213213
{%- set command = base_command ~ options %}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, name,path):
4444
self.path = path
4545

4646
def is_leak(self):
47-
content = utils.read_int_from_file(self.path, 0)
47+
content = utils.read_int_from_file(self.path, 'N/A')
4848

4949
if content == 1:
5050
self.leaking = False
@@ -54,7 +54,7 @@ def is_leak(self):
5454
return True
5555
else:
5656
logger.error(f"Failed to read leakage sensor {self.name} value: {content}")
57-
return True
57+
return 'N/A'
5858

5959
class LiquidCooling(LiquidCoolingBase):
6060
"""Platform-specific Liquid Cooling class"""

platform/mellanox/mlnx-platform-api/tests/test_liquid_cooling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_leakage_sensor_is_leak():
2626
# Test when file does not exist
2727
with mock.patch('os.path.exists') as mock_exists:
2828
mock_exists.return_value = False
29-
assert sensor.is_leak() is True
29+
assert sensor.is_leak() == 'N/A'
3030

3131
def test_liquid_cooling_init():
3232
with mock.patch('os.path.exists') as mock_exists, \

src/system-health/health_checker/hardware_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def _check_liquid_cooling_status(self, config):
327327

328328
data_dict = self._db.get_all(self._db.STATE_DB, key)
329329
leak_status = data_dict.get('leak_status', None)
330-
if leak_status is None:
330+
if leak_status is None or leak_status == 'N/A':
331331
self.set_object_not_ok('Liquid Cooling', name, 'Failed to get leakage sensor status for {}'.format(name))
332332
continue
333333

0 commit comments

Comments
 (0)