From f04520aaaa09133cc45b428bc4e42e06d1584f11 Mon Sep 17 00:00:00 2001 From: Kamil Cudnik Date: Tue, 29 Oct 2024 16:22:06 +0100 Subject: [PATCH] [rpc] Fix missing attr value for object type enum (#2095) Fixes RPC sai_adapter.py compilation issue (cherry picked from commit accd0f4d46b7fe28fa3cc23f97ad5dde90f79843) --- meta/gensairpc.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/gensairpc.pl b/meta/gensairpc.pl index 627c9438e..c21a9edb8 100755 --- a/meta/gensairpc.pl +++ b/meta/gensairpc.pl @@ -447,13 +447,14 @@ sub get_attr_type { # First, check if we have enum return 's32' if ( $attr->type->name ~~ $all_enums ); + return 's32' if ( $attr->type->name eq "sai_object_type_t" ); # special case # Try to compare types of attribute and attr value otherwise for ( @{ $attr_types->members } ) { return $_->thrift_name if ( $type eq $_->type->thrift_name ); } - carp colored( "Unknown type $type of attribute " . $attr->name, 'red' ); + croak colored( "Unknown type $type of attribute " . $attr->name, 'red' ); return; }