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 7d682428..b2faf04a 100644 --- a/common/sai_client/sai_thrift_client/sai_thrift_utils.py +++ b/common/sai_client/sai_thrift_client/sai_thrift_utils.py @@ -84,6 +84,7 @@ def convert_value_to_thrift(value, attr_name=None, value_type=None): """ if value_type is None: value_type = ThriftConverter.get_attribute_type(attr_name) + assert value_type, f"Unknown attribute {attr_name}" if value_type in [ 's8', 'u8', 's16', 'u16', 's32', 'u32', 's64', 'u64', 'ptr', @@ -399,6 +400,8 @@ def convert_value_from_thrift(value, attr_name, obj_type=None): sai_thrift_ip_address_t('192.168.0.1'...), "ipaddr" => "192.168.0.1" """ value_type = ThriftConverter.get_attribute_type(attr_name) + assert value_type, f"Unknown attribute {attr_name}" + if value_type in [ 's8', 's16', 'u32', 's64', 'u64', 'ptr', 'mac', 'ipv4', 'ipv6',