Skip to content

Commit

Permalink
[db-migrator] Fix hwsku match for 6100 and add errors when hwsku is N…
Browse files Browse the repository at this point in the history
…one (#2821)

* Fix hwsku match for 6100 and add errors when hwsku is None

* Asic type fix
  • Loading branch information
vaibhavhd committed May 30, 2023
1 parent 69abbc3 commit b5c1032
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/db_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ def __init__(self, namespace, socket=None):
self.loglevelDB.connect(self.loglevelDB.LOGLEVEL_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 @@ -989,7 +992,7 @@ def common_migration_ops(self):
# removed together with calling to migrate_copp_table function.
if self.asic_type != "mellanox":
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

0 comments on commit b5c1032

Please sign in to comment.