Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions scripts/db_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ def migrate_feature_timer(self):
config['delayed'] = state
config.pop('has_timer')
self.configDB.set_entry('FEATURE', feature, config)

def migrate_route_table(self):
"""
Handle route table migration. Migrations handled:
Expand All @@ -636,6 +637,21 @@ def migrate_route_table(self):
if 'protocol' not in route_attr:
self.appDB.set(self.appDB.APPL_DB, route_key, 'protocol', '')

def migrate_routing_config_mode(self):
# DEVICE_METADATA - synchronous_mode entry
if not self.minigraph_data or 'DEVICE_METADATA' not in self.minigraph_data:
return
device_metadata_old = self.configDB.get_entry('DEVICE_METADATA', 'localhost')
device_metadata_new = self.minigraph_data['DEVICE_METADATA']['localhost']
# overwrite the routing-config-mode as per minigraph parser
# Criteria for update:
# if config mode is missing in base OS or if base and target modes are not same
# Eg. in 201811 mode is "unified", and in newer branches mode is "separated"
if ('docker_routing_config_mode' not in device_metadata_old and 'docker_routing_config_mode' in device_metadata_new) or \
(device_metadata_old.get('docker_routing_config_mode') != device_metadata_new.get('docker_routing_config_mode')):
device_metadata_old['docker_routing_config_mode'] = device_metadata_new.get('docker_routing_config_mode')
self.configDB.set_entry('DEVICE_METADATA', 'localhost', device_metadata_old)

def update_edgezone_aggregator_config(self):
"""
Update cable length configuration in ConfigDB for T0 neighbor interfaces
Expand Down Expand Up @@ -1057,6 +1073,8 @@ def common_migration_ops(self):

# Updating edgezone aggregator cable length config for T0 devices
self.update_edgezone_aggregator_config()
# update FRR config mode based on minigraph parser on target image
self.migrate_routing_config_mode()

def migrate(self):
version = self.get_version()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@
"DEVICE_METADATA|localhost": {
"hwsku": "ACS-MSN2700",
"default_bgp_status": "up",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"hostname": "sonic",
"platform": "x86_64-mlnx_msn2700-r0",
"mac": "00:01:02:03:04:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@
"DEVICE_METADATA|localhost": {
"hwsku": "ACS-MSN2700",
"default_bgp_status": "up",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"hostname": "sonic",
"platform": "x86_64-mlnx_msn2700-r0",
"mac": "00:01:02:03:04:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@
"bgp_asn": "65100",
"buffer_model": "dynamic",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"LOSSLESS_TRAFFIC_PATTERN|AZURE": {
"small_packet_percentage": "100",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@
"bgp_asn": "65100",
"buffer_model": "dynamic",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"LOSSLESS_TRAFFIC_PATTERN|AZURE": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
},
"CONSOLE_SWITCH|console_mgmt": {
"enabled": "no"
}
}
},
"DEVICE_METADATA|localhost": {
"docker_routing_config_mode": "separated"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"DEVICE_METADATA|localhost": {
"docker_routing_config_mode": "unified"
}
}

3 changes: 2 additions & 1 deletion tests/db_migrator_input/config_db/empty-config-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"VERSION": "version_3_0_3"
},
"DEVICE_METADATA|localhost": {
"synchronous_mode": "enable"
"synchronous_mode": "enable",
"docker_routing_config_mode": "separated"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@
"DEVICE_METADATA|localhost": {
"hwsku": "Mellanox-SN2700",
"default_bgp_status": "up",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"hostname": "sonic",
"platform": "x86_64-mlnx_msn2700-r0",
"mac": "00:01:02:03:04:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@
"DEVICE_METADATA|localhost": {
"hwsku": "Mellanox-SN2700",
"default_bgp_status": "up",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"hostname": "sonic",
"platform": "x86_64-mlnx_msn2700-r0",
"mac": "00:01:02:03:04:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@
"bgp_asn": "65100",
"buffer_model": "traditional",
"deployment_id": "1",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"synchronous_mode": "enable"
},
"PORT|Ethernet0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@
"DEVICE_METADATA|localhost": {
"hwsku": "ACS-MSN2700",
"default_bgp_status": "up",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"hostname": "sonic",
"platform": "x86_64-mlnx_msn2700-r0",
"mac": "00:01:02:03:04:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@
"DEVICE_METADATA|localhost": {
"hwsku": "ACS-MSN2700",
"default_bgp_status": "up",
"docker_routing_config_mode": "unified",
"docker_routing_config_mode": "separated",
"hostname": "sonic",
"platform": "x86_64-mlnx_msn2700-r0",
"mac": "00:01:02:03:04:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
"bgp_asn": "65100",
"buffer_model": "dynamic",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"bgp_asn": "65100",
"buffer_model": "dynamic",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
"bgp_asn": "65100",
"buffer_model": "dynamic",
"deployment_id": "1",
"docker_routing_config_mode": "unified"
"docker_routing_config_mode": "separated"
},
"PORT|Ethernet0": {
"lanes": "0,1,2,3",
Expand Down
Loading