Skip to content

Commit cbf19f6

Browse files
stephenxsjleveque
authored andcommitted
[Mellanox] Don't start & stop pmon when config reload (#671)
1 parent bf79c95 commit cbf19f6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

config/main.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ def log_error(msg):
4848
syslog.syslog(syslog.LOG_ERR, msg)
4949
syslog.closelog()
5050

51+
#
52+
# Load asic_type for further use
53+
#
54+
55+
try:
56+
version_info = sonic_device_util.get_sonic_version_info()
57+
asic_type = version_info['asic_type']
58+
except KeyError, TypeError:
59+
raise click.Abort()
60+
5161
#
5262
# Helper functions
5363
#
@@ -314,13 +324,16 @@ def _abort_if_false(ctx, param, value):
314324
ctx.abort()
315325

316326
def _stop_services():
327+
# on Mellanox platform pmon is stopped by syncd
317328
services_to_stop = [
318329
'swss',
319330
'lldp',
320331
'pmon',
321332
'bgp',
322333
'hostcfgd',
323334
]
335+
if asic_type == 'mellanox' and 'pmon' in services_to_stop:
336+
services_to_stop.remove('pmon')
324337

325338
for service in services_to_stop:
326339
try:
@@ -358,6 +371,7 @@ def _reset_failed_services():
358371
raise
359372

360373
def _restart_services():
374+
# on Mellanox platform pmon is started by syncd
361375
services_to_restart = [
362376
'hostname-config',
363377
'interfaces-config',
@@ -369,6 +383,8 @@ def _restart_services():
369383
'lldp',
370384
'hostcfgd',
371385
]
386+
if asic_type == 'mellanox' and 'pmon' in services_to_restart:
387+
services_to_restart.remove('pmon')
372388

373389
for service in services_to_restart:
374390
try:
@@ -1350,8 +1366,7 @@ def asymmetric(ctx, interface_name, status):
13501366
def platform():
13511367
"""Platform-related configuration tasks"""
13521368

1353-
version_info = sonic_device_util.get_sonic_version_info()
1354-
if (version_info and version_info.get('asic_type') == 'mellanox'):
1369+
if asic_type == 'mellanox':
13551370
platform.add_command(mlnx.mlnx)
13561371

13571372
#

0 commit comments

Comments
 (0)