I've calmed down, sorry I was so livid and I did actually succeed in what I was trying to accomplish (reverse engineering the python ovs module) and it's given me a bit of perspective,
https://github.com/0x00002152/python-docker-openvswitch-plugin/blob/master/src/docker_network_plugin_service/ovs_json_rpc_native_client.py I've also seen some of the C code, specifically that for ovs-vsctl which I used some as reference. Most of what I could gather came from an e-mail regarding a commit that I can't seem to find anywhere in the source tree, but more importantly I can't find it in the README.md (no readme.md here https://github.com/openvswitch/ovs/tree/master/python/ovs ) for the ovs python module itself which in my mind seems like it could be for a few reasons: - The person who wrote the python module never documented it and isn't around to the task. This can't be too much of a problem given that the ovs-vsctl client uses the same wire protocol as well as a go client library that exists (I will not use go, I would sooner do this in C.) - It's a scam designed to get people to pay you for help (not really a scam but, personally I couldn't justify that myself if that were the case) - Working with the json-rpc API means dealing with a very complex columnar database with a lot of high availability features, varying isolation levels, and tons of ways to shoot yourself in the foot I would probably go with #3, I never would have gotten a handle on this if not for the archived email regarding commits of example code, which you will find in this log: https://gist.github.com/0x00002152/97317884ad848586eff1cdcf256dd689#gistcomment-3366276 I kept an entire log of everything I did to try to figure this out. The reason it frustrated me so badly is because people have written screen scraper python modules to accomplish what this module does, presumably because they couldn't figure out how to use the ovs python module: https://github.com/iwaseyusuke/python-ovs-vsctl It doesn't really matter why it's none of my business anyway but I am morbidly curious, what is the story with this? I love hearing these kinds of stories, I can only imagine the list of the stale topics around libvirt and people trying to get it to work with openvswitch, I never had any luck getting it to work right unless I wrote the domxml by hand (virt-manager didn't ever get around to adding support for it.) I love databases though this one is especially peculiar. I've made things that work similarly to this upsert logic: https://github.com/0x00002152/python-docker-openvswitch-plugin/blob/master/src/docker_network_plugin_service/ovs_json_rpc_native_client.py#L133 but I also know that when you hide logic using object oriented concepts like getter setters and operator overloading and such that it's really intuitive but the learning curve for people who are unfamiliar with the code is really steep. People who aren't acutely familiar with getter/setters and database patterns won't catch that. To be fair, I just barely caught it myself but I've worked with similar things in the past (I've seen way worse wizardry, this is acceptable IMHO, besides, spelling it out is a pain when you have a million other things to do.) Either way I personally like it the way it is i just wish there was some more documentation / examples up front, it's clear to me though that it's quite complex it seems to even have some column level locking based on whatever you specify in the schema helper which seems in my mind like for it's time way ahead. I know to most it's probably the least impressive aspect of openvswitch (with VXLAN/vtep, dpdk, etc) but to me, ovsdb is pretty damn cool.
_______________________________________________ discuss mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
