From 96143eef7424f5ce65ff3d6bea8709b3147fe449 Mon Sep 17 00:00:00 2001 From: arlakshm <55814491+arlakshm@users.noreply.github.com> Date: Thu, 9 Dec 2021 15:08:24 -0800 Subject: [PATCH] preserve old order for config reload (#1964) What I did Fixes Azure/sonic-buildimage#9473 How I did it Preserve the old order of the config reload Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan --- config/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config/main.py b/config/main.py index 45fd5525a1c..f914e646538 100644 --- a/config/main.py +++ b/config/main.py @@ -1421,15 +1421,17 @@ def reload(db, filename, yes, load_sysinfo, no_service_restart, disable_arp_cach # or by default DEFAULT_CONFIG_DB_FILE. In the case of database service running in namespace, # the default config_db.json format is used. + config_gen_opts = "" + + if os.path.isfile(INIT_CFG_FILE): + config_gen_opts += " -j {} ".format(INIT_CFG_FILE) + if file_format == 'config_db': config_gen_opts += ' -j {} '.format(file) else: config_gen_opts += ' -Y {} '.format(file) - if os.path.isfile(INIT_CFG_FILE): - config_gen_opts += " -j {} ".format(INIT_CFG_FILE) - if namespace is not None: config_gen_opts += " -n {} ".format(namespace)