From 56dc3ef5169b2fbc8b6ec1454ae3a829015d1df0 Mon Sep 17 00:00:00 2001 From: vikumarks <119973184+vikumarks@users.noreply.github.com> Date: Thu, 14 Sep 2023 23:24:53 -0700 Subject: [PATCH] Added support for string SAI_NULL_OBJECT_ID for Thrift RPC (#194) Signed-off-by: Vinod Kumar --- common/sai_client/sai_thrift_client/sai_thrift_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/sai_client/sai_thrift_client/sai_thrift_utils.py b/common/sai_client/sai_thrift_client/sai_thrift_utils.py index e7152fa2..6f2b1093 100644 --- a/common/sai_client/sai_thrift_client/sai_thrift_utils.py +++ b/common/sai_client/sai_thrift_client/sai_thrift_utils.py @@ -362,7 +362,7 @@ def object_id(oid): "16" => 16 "oid:0x10" => 16 """ - if oid == None or oid == 'null': + if oid == None or oid == 'null' or oid == 'SAI_NULL_OBJECT_ID': return 0 if isinstance(oid, str) and oid.startswith('oid:0x'): return int(oid[4:], 16)