Skip to content

Commit 6f84aae

Browse files
Add begin logs to config reload/config minigraph/warm-reboot/fast-reboot (#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
1 parent e98011f commit 6f84aae

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

config/main.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,8 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart, force, file_form
15491549
if not yes:
15501550
click.confirm(message, abort=True)
15511551

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

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

15701571
#Stop services before config push
15711572
if not no_service_restart:
1572-
log.log_info("'reload' stopping services...")
1573+
log.log_notice("'reload' stopping services...")
15731574
_stop_services()
15741575

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

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

17301732
#Stop services before config push
17311733
if not no_service_restart:
1732-
log.log_info("'load_minigraph' stopping services...")
1734+
log.log_notice("'load_minigraph' stopping services...")
17331735
_stop_services()
17341736

17351737
# For Single Asic platform the namespace list has the empty string
@@ -1815,7 +1817,7 @@ def load_minigraph(db, no_service_restart, traffic_shift_away, override_config,
18151817
if not no_service_restart:
18161818
_reset_failed_services()
18171819
#FIXME: After config DB daemon is implemented, we'll no longer need to restart every service.
1818-
log.log_info("'load_minigraph' restarting services...")
1820+
log.log_notice("'load_minigraph' restarting services...")
18191821
_restart_services()
18201822
click.echo("Please note setting loaded from minigraph will be lost after system reboot. To preserve setting, run `config save`.")
18211823

scripts/fast-reboot

+1
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ then
522522
exit "${EXIT_FAILURE}"
523523
fi
524524
525+
debug "Starting $REBOOT_TYPE"
525526
526527
# re-run the script in background mode with detaching from the terminal session
527528
if [[ x"${DETACH}" == x"yes" && x"${ALREADY_DETACHED}" == x"" ]]; then

0 commit comments

Comments
 (0)