Skip to content
Merged
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
12 changes: 8 additions & 4 deletions scripts/db_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ def __init__(self, namespace, socket=None):
self.stateDB.connect(self.stateDB.STATE_DB)

version_info = device_info.get_sonic_version_info()
asic_type = version_info.get('asic_type')
self.asic_type = asic_type

self.asic_type = version_info.get('asic_type')
if not self.asic_type:
log.log_error("ASIC type information not obtained. DB migration will not be reliable")
self.hwsku = device_info.get_hwsku()
if not self.hwsku:
log.log_error("HWSKU information not obtained. DB migration will not be reliable")

if asic_type == "mellanox":
if self.asic_type == "mellanox":
from mellanox_buffer_migrator import MellanoxBufferMigrator
self.mellanox_buffer_migrator = MellanoxBufferMigrator(self.configDB, self.appDB, self.stateDB)

Expand Down Expand Up @@ -751,7 +755,7 @@ def common_migration_ops(self):
self.configDB.set_entry(init_cfg_table, key, new_cfg)

self.migrate_copp_table()
if self.asic_type == "broadcom" and 'Force10-S6100' in self.hwsku:
if self.asic_type == "broadcom" and 'Force10-S6100' in str(self.hwsku):
self.migrate_mgmt_ports_on_s6100()
else:
log.log_notice("Asic Type: {}, Hwsku: {}".format(self.asic_type, self.hwsku))
Expand Down