Skip to content

Commit

Permalink
[config]: add syslog messages to config load_minigraph/reload (sonic-…
Browse files Browse the repository at this point in the history
…net#843)

add stoping/restarting services messages in syslog

Signed-off-by: Guohan Lu <lguohan@gmail.com>
  • Loading branch information
lguohan authored Mar 18, 2020
1 parent 4389ffe commit 92b30c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ def reload(filename, yes, load_sysinfo):
cfg_hwsku = cfg_hwsku.strip()

#Stop services before config push
log_info("'reload' stopping services...")
_stop_services()
config_db = ConfigDBConnector()
config_db.connect()
Expand All @@ -637,6 +638,7 @@ def reload(filename, yes, load_sysinfo):
# We first run "systemctl reset-failed" to remove the "failed"
# status from all services before we attempt to restart them
_reset_failed_services()
log_info("'reload' restarting services...")
_restart_services()

@config.command()
Expand Down Expand Up @@ -681,6 +683,7 @@ def load_minigraph():
device_type = device_type.strip()

#Stop services before config push
log_info("'load_minigraph' stopping services...")
_stop_services()

config_db = ConfigDBConnector()
Expand Down Expand Up @@ -708,6 +711,7 @@ def load_minigraph():
# status from all services before we attempt to restart them
_reset_failed_services()
#FIXME: After config DB daemon is implemented, we'll no longer need to restart every service.
log_info("'load_minigraph' restarting services...")
_restart_services()
click.echo("Please note setting loaded from minigraph will be lost after system reboot. To preserve setting, run `config save`.")

Expand Down

0 comments on commit 92b30c2

Please sign in to comment.