Skip to content

Commit 634e4e3

Browse files
kcudniklguohan
authored andcommitted
[meta] Return OBJECT_IN_USE when removing port is in use (sonic-net#553)
1 parent 84b0eed commit 634e4e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

meta/sai_meta.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1829,15 +1829,15 @@ sai_status_t meta_port_remove_validation(
18291829
SWSS_LOG_ERROR("port %s reference count is not zero, can't remove",
18301830
sai_serialize_object_id(port_id).c_str());
18311831

1832-
return SAI_STATUS_FAILURE;
1832+
return SAI_STATUS_OBJECT_IN_USE;
18331833
}
18341834

18351835
if (!meta_is_object_in_default_state(port_id))
18361836
{
18371837
SWSS_LOG_ERROR("port %s is not in default state, can't remove",
18381838
sai_serialize_object_id(port_id).c_str());
18391839

1840-
return SAI_STATUS_FAILURE;
1840+
return SAI_STATUS_OBJECT_IN_USE;
18411841
}
18421842

18431843
for (auto oid: it->second)
@@ -1848,15 +1848,15 @@ sai_status_t meta_port_remove_validation(
18481848
sai_serialize_object_id(port_id).c_str(),
18491849
sai_serialize_object_id(oid).c_str());
18501850

1851-
return SAI_STATUS_FAILURE;
1851+
return SAI_STATUS_OBJECT_IN_USE;
18521852
}
18531853

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

1859-
return SAI_STATUS_FAILURE;
1859+
return SAI_STATUS_OBJECT_IN_USE;
18601860
}
18611861
}
18621862

0 commit comments

Comments
 (0)