Skip to content

Commit accd0f4

Browse files
authored
[rpc] Fix missing attr value for object type enum (#2095)
Fixes RPC sai_adapter.py compilation issue
1 parent 8f500eb commit accd0f4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

meta/gensairpc.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,14 @@ sub get_attr_type {
447447

448448
# First, check if we have enum
449449
return 's32' if ( $attr->type->name ~~ $all_enums );
450+
return 's32' if ( $attr->type->name eq "sai_object_type_t" ); # special case
450451

451452
# Try to compare types of attribute and attr value otherwise
452453
for ( @{ $attr_types->members } ) {
453454
return $_->thrift_name if ( $type eq $_->type->thrift_name );
454455
}
455456

456-
carp colored( "Unknown type $type of attribute " . $attr->name, 'red' );
457+
croak colored( "Unknown type $type of attribute " . $attr->name, 'red' );
457458
return;
458459
}
459460

0 commit comments

Comments
 (0)