Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mellanox] Don't start & stop pmon when config reload #671

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ def log_error(msg):
syslog.syslog(syslog.LOG_ERR, msg)
syslog.closelog()

#
# Load asic_type for further use
#

try:
version_info = sonic_device_util.get_sonic_version_info()
asic_type = version_info['asic_type']
except KeyError, TypeError:
raise click.Abort()

#
# Helper functions
#
Expand Down Expand Up @@ -287,13 +297,16 @@ def _abort_if_false(ctx, param, value):
ctx.abort()

def _stop_services():
# on Mellanox platform pmon is stopped by syncd
services_to_stop = [
'swss',
'lldp',
'pmon',
stephenxs marked this conversation as resolved.
Show resolved Hide resolved
'bgp',
'hostcfgd',
]
if asic_type == 'mellanox' and 'pmon' in services_to_stop:
services_to_stop.remove('pmon')

for service in services_to_stop:
try:
Expand Down Expand Up @@ -337,6 +350,7 @@ def _reset_failed_services():
raise

def _restart_services():
# on Mellanox platform pmon is started by syncd
services_to_restart = [
'hostname-config',
'interfaces-config',
Expand All @@ -348,6 +362,8 @@ def _restart_services():
'lldp',
'hostcfgd',
]
if asic_type == 'mellanox' and 'pmon' in services_to_restart:
services_to_restart.remove('pmon')

for service in services_to_restart:
try:
Expand Down Expand Up @@ -1310,8 +1326,7 @@ def asymmetric(ctx, status):
def platform():
"""Platform-related configuration tasks"""

version_info = sonic_device_util.get_sonic_version_info()
if (version_info and version_info.get('asic_type') == 'mellanox'):
if asic_type == 'mellanox':
platform.add_command(mlnx.mlnx)

#
Expand Down