From 634e4e3a2ce8ba29f70613ccd35c20d9d2ce5bab Mon Sep 17 00:00:00 2001 From: Kamil Cudnik Date: Wed, 22 Jan 2020 21:15:56 +0100 Subject: [PATCH] [meta] Return OBJECT_IN_USE when removing port is in use (#553) --- meta/sai_meta.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/sai_meta.cpp b/meta/sai_meta.cpp index 0845f8d6703f..2ed617d66f3a 100644 --- a/meta/sai_meta.cpp +++ b/meta/sai_meta.cpp @@ -1829,7 +1829,7 @@ 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)) @@ -1837,7 +1837,7 @@ sai_status_t meta_port_remove_validation( 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) @@ -1848,7 +1848,7 @@ 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)) @@ -1856,7 +1856,7 @@ sai_status_t meta_port_remove_validation( 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; } }