aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2012-05-22 01:53:07 -0700
committerEthan Jackson <ethan@nicira.com>2012-06-14 16:41:44 -0700
commita699f6143e09b1d63ea284b7d8180c74f27dea60 (patch)
tree27e2567365c14d7423f299ba7cf4e4da4ff7a40f /python
parent79f1cbe9f86ddfb1b5d92b80d85e09cd44768d6c (diff)
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>
Diffstat (limited to 'python')
-rw-r--r--python/ovs/db/types.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/ovs/db/types.py b/python/ovs/db/types.py
index 96cdae82..5865acd7 100644
--- a/python/ovs/db/types.py
+++ b/python/ovs/db/types.py
@@ -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))