Skip to content

Commit

Permalink
[rpc] Fix missing attr value for object type enum (opencomputeproject…
Browse files Browse the repository at this point in the history
…#2095)

Fixes RPC sai_adapter.py compilation issue

(cherry picked from commit accd0f4)
  • Loading branch information
kcudnik authored and shanshri committed Nov 14, 2024
1 parent 9fee2f6 commit f04520a
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 f04520a

Please sign in to comment.