Skip to content

Commit

Permalink
Add begin logs to config reload/config minigraph/warm-reboot/fast-reb…
Browse files Browse the repository at this point in the history
…oot (#2694)

- What I did
Add more logs for config reload/config minigraph/warm-reboot/fast/reboot to identify in the log (notice level) what was the command executed which could cause a service affect.

- How I did it
Add more logs for config reload/config minigraph/warm-reboot/fast/reboot.

- How to verify it
Manual test
  • Loading branch information
Junchao-Mellanox authored Feb 27, 2023
1 parent e98011f commit 6f84aae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,8 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart, force, file_form
if not yes:
click.confirm(message, abort=True)

log.log_info("'reload' executing...")
argv_str = ' '.join(['config', *sys.argv[1:]])
log.log_notice(f"'reload' executing with command: {argv_str}")

num_asic = multi_asic.get_num_asics()
cfg_files = []
Expand All @@ -1569,7 +1570,7 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart, force, file_form

#Stop services before config push
if not no_service_restart:
log.log_info("'reload' stopping services...")
log.log_notice("'reload' stopping services...")
_stop_services()

# In Single ASIC platforms we have single DB service. In multi-ASIC platforms we have a global DB
Expand Down Expand Up @@ -1678,7 +1679,7 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart, force, file_form
# status from all services before we attempt to restart them
if not no_service_restart:
_reset_failed_services()
log.log_info("'reload' restarting services...")
log.log_notice("'reload' restarting services...")
_restart_services()

@config.command("load_mgmt_config")
Expand Down Expand Up @@ -1725,11 +1726,12 @@ def load_mgmt_config(filename):
@clicommon.pass_db
def load_minigraph(db, no_service_restart, traffic_shift_away, override_config, golden_config_path):
"""Reconfigure based on minigraph."""
log.log_info("'load_minigraph' executing...")
argv_str = ' '.join(['config', *sys.argv[1:]])
log.log_notice(f"'load_minigraph' executing with command: {argv_str}")

#Stop services before config push
if not no_service_restart:
log.log_info("'load_minigraph' stopping services...")
log.log_notice("'load_minigraph' stopping services...")
_stop_services()

# For Single Asic platform the namespace list has the empty string
Expand Down Expand Up @@ -1815,7 +1817,7 @@ def load_minigraph(db, no_service_restart, traffic_shift_away, override_config,
if not no_service_restart:
_reset_failed_services()
#FIXME: After config DB daemon is implemented, we'll no longer need to restart every service.
log.log_info("'load_minigraph' restarting services...")
log.log_notice("'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
1 change: 1 addition & 0 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ then
exit "${EXIT_FAILURE}"
fi
debug "Starting $REBOOT_TYPE"
# re-run the script in background mode with detaching from the terminal session
if [[ x"${DETACH}" == x"yes" && x"${ALREADY_DETACHED}" == x"" ]]; then
Expand Down

0 comments on commit 6f84aae

Please sign in to comment.