Skip to content

Commit 051f28c

Browse files
vaibhavhdyxieca
authored andcommitted
[db-migrator] Fix hwsku match for 6100 and add errors when hwsku is None (#2821)
* Fix hwsku match for 6100 and add errors when hwsku is None * Asic type fix
1 parent cd08aa6 commit 051f28c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/db_migrator.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,14 @@ def __init__(self, namespace, socket=None):
7373
self.stateDB.connect(self.stateDB.STATE_DB)
7474

7575
version_info = device_info.get_sonic_version_info()
76-
asic_type = version_info.get('asic_type')
77-
self.asic_type = asic_type
76+
self.asic_type = version_info.get('asic_type')
77+
if not self.asic_type:
78+
log.log_error("ASIC type information not obtained. DB migration will not be reliable")
7879
self.hwsku = device_info.get_hwsku()
80+
if not self.hwsku:
81+
log.log_error("HWSKU information not obtained. DB migration will not be reliable")
7982

80-
if asic_type == "mellanox":
83+
if self.asic_type == "mellanox":
8184
from mellanox_buffer_migrator import MellanoxBufferMigrator
8285
self.mellanox_buffer_migrator = MellanoxBufferMigrator(self.configDB, self.appDB, self.stateDB)
8386

@@ -922,7 +925,7 @@ def common_migration_ops(self):
922925

923926
if self.asic_type != "mellanox":
924927
self.migrate_copp_table()
925-
if self.asic_type == "broadcom" and 'Force10-S6100' in self.hwsku:
928+
if self.asic_type == "broadcom" and 'Force10-S6100' in str(self.hwsku):
926929
self.migrate_mgmt_ports_on_s6100()
927930
else:
928931
log.log_notice("Asic Type: {}, Hwsku: {}".format(self.asic_type, self.hwsku))

0 commit comments

Comments
 (0)