Skip to content

Commit

Permalink
[rpc] Fix missing attr value for object type enum (#2095)
Browse files Browse the repository at this point in the history
Fixes RPC sai_adapter.py compilation issue
  • Loading branch information
kcudnik authored Oct 29, 2024
1 parent 8f500eb commit accd0f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion meta/gensairpc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit accd0f4

Please sign in to comment.