IDL_S_MONITOR_REQUESTED = 1
IDL_S_MONITOR_COND_REQUESTED = 2
- def __init__(self, remote, schema, probe_interval=None):
+ def __init__(self, remote, schema_helper, probe_interval=None):
"""Creates and returns a connection to the database named 'db_name' on
'remote', which should be in a form acceptable to
ovs.jsonrpc.session.open(). The connection will maintain an in-memory
replica of the remote database.
- 'schema' should be the schema for the remote database. The caller may
- have cut it down by removing tables or columns that are not of
- interest. The IDL will only replicate the tables and columns that
- remain. The caller may also add a attribute named 'alert' to selected
- remaining columns, setting its value to False; if so, then changes to
- those columns will not be considered changes to the database for the
- purpose of the return value of Idl.run() and Idl.change_seqno. This is
- useful for columns that the IDL's client will write but not read.
+ 'schema_helper' should be an instance of the SchemaHelper class which
+ generates schema for the remote database. The caller may have cut it
+ down by removing tables or columns that are not of interest. The IDL
+ will only replicate the tables and columns that remain. The caller may
+ also add an attribute named 'alert' to selected remaining columns,
+ setting its value to False; if so, then changes to those columns will
+ not be considered changes to the database for the purpose of the return
+ value of Idl.run() and Idl.change_seqno. This is useful for columns
+ that the IDL's client will write but not read.
As a convenience to users, 'schema' may also be an instance of the
SchemaHelper class.
milliseconds. If None it will just use the default value in OVS.
"""
- assert isinstance(schema, SchemaHelper)
- schema = schema.get_idl_schema()
+ assert isinstance(schema_helper, SchemaHelper)
+ schema = schema_helper.get_idl_schema()
self.tables = schema.tables
self.readonly = schema.readonly