mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
lib: Utilize smaps in the idl.
String to string maps are used all over the Open vSwitch database. Before this patch, they were implemented in the idl as parallel string arrays. This strategy has proven a bit cumbersome. With this patch, string to string maps are implemented using the smap library. Signed-off-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
@@ -450,6 +450,11 @@ class Type(object):
|
||||
def is_map(self):
|
||||
return self.value is not None
|
||||
|
||||
def is_smap(self):
|
||||
return (self.is_map()
|
||||
and self.key.type == StringType
|
||||
and self.value.type == StringType)
|
||||
|
||||
def is_optional_pointer(self):
|
||||
return (self.is_optional() and not self.value
|
||||
and (self.key.type == StringType or self.key.ref_table_name))
|
||||
|
Reference in New Issue
Block a user