-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[config reload] Call systemctl reset-failed for snmp,telemetry,mgmt-framework services #1773
[config reload] Call systemctl reset-failed for snmp,telemetry,mgmt-framework services #1773
Conversation
…ramework services
@@ -681,11 +681,16 @@ def _stop_services(): | |||
|
|||
def _get_sonic_services(): | |||
out = clicommon.run_command("systemctl list-dependencies --plain sonic.target | sed '1d'", return_cmd=True) | |||
return [unit.strip() for unit in out.splitlines()] | |||
return (unit.strip() for unit in out.splitlines()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a generator. I suppose generator is more efficiency.
a = (str(x) for x in range(10))
print(type(a))
Output:
<class 'generator'>
tests/config_test.py
Outdated
@@ -55,7 +55,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 == 7 | |||
assert mock_run_command.call_count == 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Added a few checks in this test case, please help review.
…ramework services (#1773) #### What I did When issue `config reload -y` or `config load_minigraph -y` command, most of the sonic services will be reset by command `systemctl reset-failed <service_name>`. The purpose is to avoid services reach to its start retry limit and cannot be started. However, `systemctl reset-failed` only resets those services belong to sonic.target, snmp, telemetry and mgmt-framework are not part of them. So if we run `config reload -y` or `config load_minigraph -y` continues, snmp, telemetry and mgmt-framework services might enter into failed state. This PR is to fix the issue. I would like to cherry-pick this fix to 202012 branch, but this fix also depends on PR sonic-net/sonic-buildimage#7846. So if we decide to cherry-pick this PR to 202012, we need cherry-pick sonic-net/sonic-buildimage#7846 first. #### How I did it Also call `systemctl reset-failed` for services like snmp, telemetry and mgmt-framework. #### How to verify it Manual test.
This PR could not be cleanly cherry-pick to 202012. Please submit another PR. |
…ramework services (sonic-net#1773) When issue `config reload -y` or `config load_minigraph -y` command, most of the sonic services will be reset by command `systemctl reset-failed <service_name>`. The purpose is to avoid services reach to its start retry limit and cannot be started. However, `systemctl reset-failed` only resets those services belong to sonic.target, snmp, telemetry and mgmt-framework are not part of them. So if we run `config reload -y` or `config load_minigraph -y` continues, snmp, telemetry and mgmt-framework services might enter into failed state. This PR is to fix the issue. I would like to cherry-pick this fix to 202012 branch, but this fix also depends on PR sonic-net/sonic-buildimage#7846. So if we decide to cherry-pick this PR to 202012, we need cherry-pick sonic-net/sonic-buildimage#7846 first. Also call `systemctl reset-failed` for services like snmp, telemetry and mgmt-framework. Manual test. +
This commit could not be cleanly cherry-pick to 202012. Please submit another PR. |
…ramework services (#1773) (#1786) Back port PR #1773 to 202012 branch. #### What I did When issue `config reload -y` or `config load_minigraph -y` command, most of the sonic services will be reset by command `systemctl reset-failed <service_name>`. The purpose is to avoid services reach to its start retry limit and cannot be started. However, `systemctl reset-failed` only resets those services belong to sonic.target, snmp, telemetry and mgmt-framework are not part of them. So if we run `config reload -y` or `config load_minigraph -y` continues, snmp, telemetry and mgmt-framework services might enter into failed state. This PR is to fix the issue. #### How I did it Also call `systemctl reset-failed` for services like snmp, telemetry and mgmt-framework. #### How to verify it Manual test.
…627) 7041400 [config reload] Call systemctl reset-failed for snmp,telemetry,mgmt-framework services (sonic-net#1773) (sonic-net#1786) 399d370 Fix logic in RIF counters print (sonic-net#1732) 8329544 [vnet_route_check] don't hardcode prefix length of /24 (sonic-net#1756) 193b028 [neighbor-advertiser] delete the tunnel maps appropriately (sonic-net#1663) 2c82bcf [neighbor_advertiser] Use existing tunnel if present for creating tunnel mappings (sonic-net#1589) 8e22960 [202012][Config] Update config command of Kdump. (sonic-net#1778) be3e5c6 [show][config] cli refactor for muxcable with abstract class implementation from vendors (sonic-net#1722) (sonic-net#1782)
What I did
When issue
config reload -y
orconfig load_minigraph -y
command, most of the sonic services will be reset by commandsystemctl reset-failed <service_name>
. The purpose is to avoid services reach to its start retry limit and cannot be started. However,systemctl reset-failed
only resets those services belong to sonic.target, snmp, telemetry and mgmt-framework are not part of them. So if we runconfig reload -y
orconfig load_minigraph -y
continues, snmp, telemetry and mgmt-framework services might enter into failed state. This PR is to fix the issue.I would like to cherry-pick this fix to 202012 branch, but this fix also depends on PR sonic-net/sonic-buildimage#7846. So if we decide to cherry-pick this PR to 202012, we need cherry-pick sonic-net/sonic-buildimage#7846 first.
How I did it
Also call
systemctl reset-failed
for services like snmp, telemetry and mgmt-framework.How to verify it
Manual test.
Previous command output (if the output of a command-line utility has changed)
No command output changes.
New command output (if the output of a command-line utility has changed)
No command output changes.