ovs-monitor-ipsec: Use same pattern as ovs-xapi-sync.
authorBen Pfaff <blp@nicira.com>
Thu, 8 Mar 2012 19:23:14 +0000 (11:23 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 12 Apr 2012 15:18:59 +0000 (08:18 -0700)
This does not fix an actual bug in ovs-monitor-ipsec because it does not
ever commit any changes to the database.

Signed-off-by: Ben Pfaff <blp@nicira.com>
debian/ovs-monitor-ipsec

index a4a4575491b31028ae1ba7e71027245cbad8446e..50242774a2933164ae28c030f02b620649e46439 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright (c) 2009, 2010, 2011 Nicira Networks
+# Copyright (c) 2009, 2010, 2011, 2012 Nicira Networks
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -421,17 +421,20 @@ def main():
     ipsec = IPsec()
 
     interfaces = {}
+    seqno = idl.change_seqno    # Sequence number when we last processed the db
     while True:
         unixctl_server.run()
         if exiting:
             break
 
-        if not idl.run():
+        idl.run()
+        if seqno == idl.change_seqno:
             poller = ovs.poller.Poller()
             unixctl_server.wait(poller)
             idl.wait(poller)
             poller.block()
             continue
+        seqno = idl.change_seqno
 
         ssl_cert = get_ssl_cert(idl.tables)