[ovs-dev] [PATCH V6] Add Passive TCP connection to IDL.

Ofer Ben-Yacov ofer.benyacov at gmail.com
Wed Mar 2 07:40:29 UTC 2016


Actually, SchemaHelper supports both ways: getting the schema from the
server or read it from file (schema_json / location parameters). Neutron
took the first approach probably because they wanted all the tables anyway.


If we want to keep supporting getting the schema from the server, than my
change of sending the open stream to IDL is a must.
If you want to have the file option only (even if it is currently coded
differently), than I will change the patch to support only getting the
schema form a file.


Ofer.


‫בתאריך יום ב׳, 29 בפבר׳ 2016 ב-19:58 מאת ‪Ben Pfaff‬‏ <‪blp at ovn.org‬‏>:‬

> That's not how the Python version of the IDL is meant to be used.
> SchemaHelper operates on the schema that the client *wants*, not on the
> schema that the database server *has*.  That's why it reads the schema
> from a local disk file by default.  If Neutron does something else then
> it should probably be changed.
>
> On Mon, Feb 29, 2016 at 08:06:33AM +0000, Ofer Ben-Yacov wrote:
> > Take a loot at the contractor of IDL:
> >
> > ...
> > def __init__(self, remote, schema):
> > ...
> >
> >
> > You can see that it gets schema as a parameter, which is actually
> > SchemaHelper object:
> >
> > ...
> > assert isinstance(schema, SchemaHelper)
> > ...
> >
> >
> > This object holds the schema in a json string (schema_json) until you
> will
> > call its register_columns function which will build the tables.
> >
> > You can see that the IDL, when first built, is getting the schema which
> > means that the OVSDB server was already connected beforehand to get it.
> >
> > If you should like to know how this is done, you can look at Neutron's
> > idlutils.py file and check the get_schema_helper() function.
> >
> > You can see that it gets the schema name as a parameter, connects to the
> > OVSDB, get the schema, close the connection and
> > return SchemaHelper object to be used for the above.
> >
> >
> > Note that after this patch will be committed, I'm going to send a patch
> to
> > Neutron to add another function similar to get_schema_helper() with the
> > the deference that it will get stream (open connection to the OVSDB
> server)
> > as a parameter and get the schema from the server without closing it when
> > done.
> >
> > Ofer.
> >
> >
> >
> >
> >
> >
> >
> >
> > ‫בתאריך שבת, 27 בפבר׳ 2016 ב-3:13 מאת ‪Ben Pfaff‬‏ <‪blp at ovn.org‬‏>:‬
> >
> > > On Wed, Feb 24, 2016 at 08:39:02AM +0000, Ofer Ben-Yacov wrote:
> > > > The current implementation IDL is:
> > > > 1. connects to the OVSDB
> > > > 2. get the schema and
> > > > 3. disconnect
> > > > 4. connect again to work with the OVSDB server.
> > >
> > > I don't understand--where do you see that behavior?  I can't spot it
> > > anywhere.  The code I see in python/ovs/db/idl.py doesn't seem to do
> > > anything like it.
> > >
>



More information about the dev mailing list