Skip to content

Commit

Permalink
Return correct error code when port is in use (#565)
Browse files Browse the repository at this point in the history
Co-authored-by: Vasant <[email protected]>
  • Loading branch information
vasant17 and Vasant authored Apr 6, 2020
1 parent 2189c2f commit cd82389
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions meta/Meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2958,7 +2958,7 @@ sai_status_t Meta::meta_generic_validation_remove(

SWSS_LOG_ERROR("object 0x%" PRIx64 " reference count is %d, can't remove", oid, count);

return SAI_STATUS_INVALID_PARAMETER;
return SAI_STATUS_OBJECT_IN_USE;
}

if (meta_key.objecttype == SAI_OBJECT_TYPE_PORT)
Expand Down Expand Up @@ -2987,14 +2987,6 @@ sai_status_t Meta::meta_port_remove_validation(
return SAI_STATUS_SUCCESS;
}

if (m_oids.getObjectReferenceCount(port_id) != 0)
{
SWSS_LOG_ERROR("port %s reference count is not zero, can't remove",
sai_serialize_object_id(port_id).c_str());

return SAI_STATUS_OBJECT_IN_USE;
}

if (!meta_is_object_in_default_state(port_id))
{
SWSS_LOG_ERROR("port %s is not in default state, can't remove",
Expand Down

0 comments on commit cd82389

Please sign in to comment.