File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,7 +140,6 @@ void SaiSwitch::getDefaultMacAddress(
140140sai_switch_type_t SaiSwitch::getSwitchType () const
141141{
142142 SWSS_LOG_ENTER ();
143-
144143 sai_attribute_t attr;
145144
146145 attr.id = SAI_SWITCH_ATTR_TYPE;
@@ -149,10 +148,12 @@ sai_switch_type_t SaiSwitch::getSwitchType() const
149148
150149 if (status != SAI_STATUS_SUCCESS)
151150 {
152- SWSS_LOG_THROW (" failed to get switch type" );
151+ SWSS_LOG_ERROR (" failed to get switch type with status:0x%x. Assume default SAI_SWITCH_TYPE_NPU" , status);
152+ // Set to SAI_SWITCH_TYPE_NPU and move on
153+ attr.value .s32 = SAI_SWITCH_TYPE_NPU;
153154 }
154155
155- SWSS_LOG_ERROR (" switch type: '%s'" , (attr.value .s32 == SAI_SWITCH_TYPE_NPU ? " SAI_SWITCH_TYPE_NPU" : " SAI_SWITCH_TYPE_PHY" ));
156+ SWSS_LOG_INFO (" switch type: '%s'" , (attr.value .s32 == SAI_SWITCH_TYPE_NPU ? " SAI_SWITCH_TYPE_NPU" : " SAI_SWITCH_TYPE_PHY" ));
156157
157158 return (sai_switch_type_t ) attr.value .s32 ;
158159}
You can’t perform that action at this time.
0 commit comments