From: Isaku Yamahata Date: Thu, 13 Sep 2012 02:22:53 +0000 (+0900) Subject: python/ovs/db/idl: add counterpart of ovsdb_idl_add_table() X-Git-Tag: sliver-openvswitch-1.8.90-0~15^2~3 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=7698e31d6a3467948224f056183427f4b8f2d4d9 python/ovs/db/idl: add counterpart of ovsdb_idl_add_table() Add register_table method to SchemaHelper as Python counterpart of ovsdb_idl_add_table() in the C version of the IDL. Signed-off-by: Isaku Yamahata Signed-off-by: Ben Pfaff --- diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index e4b98e8b4..5b06d9101 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -1224,6 +1224,15 @@ class SchemaHelper(object): columns = set(columns) | self._tables.get(table, set()) self._tables[table] = columns + def register_table(self, table): + """Registers interest in the given all columns of 'table'. Future calls + to get_idl_schema() will include all columns of 'table'. + + 'table' must be a string + """ + assert type(table) is str + self._tables[table] = set() # empty set means all columns in the table + def register_all(self): """Registers interest in every column of every table.""" self._all = True @@ -1249,6 +1258,10 @@ class SchemaHelper(object): assert table_name in schema.tables table = schema.tables[table_name] + if not columns: + # empty set means all columns in the table + return table + new_columns = {} for column_name in columns: assert type(column_name) is str