Skip to content

Commit

Permalink
Revert "[config] Enable/disable container monitoring when starting/st…
Browse files Browse the repository at this point in the history
…opping the services. (sonic-net#1471)"

This reverts commit 4a78c01.
  • Loading branch information
lguohan committed Mar 11, 2021
1 parent e1c52a0 commit 6ced42c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
6 changes: 0 additions & 6 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,6 @@ def _get_disabled_services_list(config_db):


def _stop_services():
click.echo("Disabling container monitoring ...")
clicommon.run_command("sudo monit unmonitor container_checker")

click.echo("Stopping SONiC target ...")
clicommon.run_command("sudo systemctl stop sonic.target")

Expand All @@ -695,9 +692,6 @@ def _restart_services():
click.echo("Reloading Monit configuration ...")
clicommon.run_command("sudo monit reload")

click.echo("Enabling container monitoring ...")
clicommon.run_command("sudo monit monitor container_checker")


def interface_is_in_vlan(vlan_member_table, interface_name):
""" Check if an interface is in a vlan """
Expand Down
4 changes: 1 addition & 3 deletions tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
from utilities_common.db import Db

load_minigraph_command_output="""\
Disabling container monitoring ...
Stopping SONiC target ...
Running command: /usr/local/bin/sonic-cfggen -H -m --write-to-db
Running command: pfcwd start_default
Running command: config qos reload --no-dynamic-buffer
Restarting SONiC target ...
Reloading Monit configuration ...
Enabling container monitoring ...
Please note setting loaded from minigraph will be lost after system reboot. To preserve setting, run `config save`.
"""

Expand Down Expand Up @@ -51,7 +49,7 @@ def test_load_minigraph(self, get_cmd_module, setup_single_broadcom_asic):
traceback.print_tb(result.exc_info[2])
assert result.exit_code == 0
assert "\n".join([l.rstrip() for l in result.output.split('\n')]) == load_minigraph_command_output
assert mock_run_command.call_count == 9
assert mock_run_command.call_count == 7

@classmethod
def teardown_class(cls):
Expand Down

0 comments on commit 6ced42c

Please sign in to comment.