Skip to content

Commit

Permalink
Fix in switchorch: unsupported attribute causes skipping of processin…
Browse files Browse the repository at this point in the history
…g the rest of configurations (sonic-net#3209)

What I did
Changed it so that if the configuration has an unsupported attribute, it would continue processing the rest of the configuration rather than break out of the loop and end the processing immediately.
Also added syslogs to make it more clear.
  • Loading branch information
amazor authored Jul 2, 2024
1 parent 0158d27 commit c9c78dc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion orchagent/switchorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,18 @@ void SwitchOrch::doAppSwitchTableTask(Consumer &consumer)
invalid_attr = true;
break;
}
if (invalid_attr || unsupported_attr)
if (invalid_attr)
{
/* break from kfvFieldsValues for loop */
SWSS_LOG_ERROR("Invalid Attribute %s", attribute.c_str());
// Will not continue to set the rest of the attributes
break;
}
if (unsupported_attr){
SWSS_LOG_ERROR("Unsupported Attribute %s", attribute.c_str());
// Continue to set the rest of the attributes, even if current attribute is unsupported
continue;
}

sai_status_t status = sai_switch_api->set_switch_attribute(gSwitchId, &attr);
if (status != SAI_STATUS_SUCCESS)
Expand Down

0 comments on commit c9c78dc

Please sign in to comment.