Skip to content

Commit 3142e48

Browse files
author
Ashutosh Agrawal
authored
Merge branch 'opencomputeproject:main' into DASH-issue-345
2 parents ccff50f + ade30b9 commit 3142e48

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

common/sai_client/sai_thrift_client/sai_thrift_utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def convert_value_to_thrift(value, attr_name=None, value_type=None):
8484
"""
8585
if value_type is None:
8686
value_type = ThriftConverter.get_attribute_type(attr_name)
87+
assert value_type, f"Unknown attribute {attr_name}"
8788

8889
if value_type in [ 's8', 'u8', 's16', 'u16', 's32',
8990
'u32', 's64', 'u64', 'ptr',
@@ -399,6 +400,8 @@ def convert_value_from_thrift(value, attr_name, obj_type=None):
399400
sai_thrift_ip_address_t('192.168.0.1'...), "ipaddr" => "192.168.0.1"
400401
"""
401402
value_type = ThriftConverter.get_attribute_type(attr_name)
403+
assert value_type, f"Unknown attribute {attr_name}"
404+
402405
if value_type in [ 's8', 's16',
403406
'u32', 's64', 'u64',
404407
'ptr', 'mac', 'ipv4', 'ipv6',

0 commit comments

Comments
 (0)