Skip to content

Commit 2292a85

Browse files
committed
Changes to make the docker_device_config_mode to unified
Signed-off-by: Vidya Chidambaram <vidya.chidambaram@dell.com>
1 parent ebb17ca commit 2292a85

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

scripts/db_migrator.py

+19
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,23 @@ def migrate_flex_counter_delay_status_removal(self):
822822
self.configDB.set_entry('FLEX_COUNTER_TABLE', obj, flex_counter)
823823

824824

825+
def migrate_frr_separate_config_mode (self):
826+
"""
827+
Modify docker_routing_config_mode field.
828+
"""
829+
log.log_notice('Migrate FRR Config mode configuration')
830+
metadata = self.configDB.get_entry('DEVICE_METADATA', 'localhost')
831+
#device_metadata_data = self.config_src_data["DEVICE_METADATA"]["localhost"]
832+
#metadata['docker_router_config_mode'] = "unified"
833+
if 'docker_routing_config_mode' not in metadata:
834+
metadata['docker_routing_config_mode'] = "unified"
835+
self.configDB.set_entry('DEVICE_METADATA', 'localhost', metadata)
836+
else:
837+
if metadata['docker_routing_config_mode'] == "separated" :
838+
metadata['docker_routing_config_mode'] = "unified"
839+
self.configDB.set_entry('DEVICE_METADATA', 'localhost', metadata)
840+
841+
825842
def migrate_sflow_table(self):
826843
"""
827844
Migrate "SFLOW_TABLE" and "SFLOW_SESSION_TABLE" to update default sample_direction
@@ -1357,6 +1374,8 @@ def common_migration_ops(self):
13571374
self.migrate_tacplus()
13581375
self.migrate_aaa()
13591376

1377+
self.migrate_frr_separate_config_mode()
1378+
13601379
def migrate(self):
13611380
version = self.get_version()
13621381
log.log_info('Upgrading from version ' + version)

0 commit comments

Comments
 (0)