Skip to content

Commit

Permalink
[meta] Return OBJECT_IN_USE when removing port is in use (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored and lguohan committed Jan 22, 2020
1 parent 84b0eed commit 634e4e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions meta/sai_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1829,15 +1829,15 @@ sai_status_t meta_port_remove_validation(
SWSS_LOG_ERROR("port %s reference count is not zero, can't remove",
sai_serialize_object_id(port_id).c_str());

return SAI_STATUS_FAILURE;
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",
sai_serialize_object_id(port_id).c_str());

return SAI_STATUS_FAILURE;
return SAI_STATUS_OBJECT_IN_USE;
}

for (auto oid: it->second)
Expand All @@ -1848,15 +1848,15 @@ sai_status_t meta_port_remove_validation(
sai_serialize_object_id(port_id).c_str(),
sai_serialize_object_id(oid).c_str());

return SAI_STATUS_FAILURE;
return SAI_STATUS_OBJECT_IN_USE;
}

if (!meta_is_object_in_default_state(oid))
{
SWSS_LOG_ERROR("port related object %s is not in default state, can't remove",
sai_serialize_object_id(oid).c_str());

return SAI_STATUS_FAILURE;
return SAI_STATUS_OBJECT_IN_USE;
}
}

Expand Down

0 comments on commit 634e4e3

Please sign in to comment.