[ovs-discuss] OVS Python IDL fetching database

mkobus mkobus at o2.pl
Thu Jan 16 12:49:34 UTC 2020

Hi MailingList!   I'm trying to write Python script using OVS library to fetch DB content and print all current bridges, ports and interfaces. Following snippet shows what I deduced so far from examples found in  mail.openvswitch.org mail.openvswitch.org :   ```  import ovs.db.idl  import ovs.poller   SCHEMA_PATH = "/usr/share/openvswitch/vswitc  SOCKET_PATH = 'punix:/run/openvswitch/db.soc   schema_helper = ovs.db.idl.SchemaHelper(SCHEMA   schema_helper.register_columns      "Bridge", ["name", "ports"]  )  schema_helper.register_columns      "Port", ["name", "interfaces"]  )  schema_helper.register_columns      "Interface", []  )   idl = ovs.db.idl.Idl(SOCKET_PATH, schema_helper)   while not idl.run():      poller = ovs.poller.Poller()      print('Seqno value {}'.format(idl.change_seqno))      idl.wait(poller)      poller.block()  ```   As I understand idl.run() should return `True` after DB content was fetched. In my case this loop is infinite - seqno doesn't change. There is no error though.   I checked listing OVS resources using cli for version:   ovs-vsctl (Open vSwitch) 2.9.5  DB Schema 7.15.1   and those commands worked perfectly fine.   Has anyone encountered similar issue?   Regards,  MK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20200116/27a42df8/attachment.html>

More information about the discuss mailing list