]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Let OVSQuantumTunnelAgent sync with database
authorHiroaki KAWAI <hiroaki.kawai@gmail.com>
Wed, 2 May 2012 09:27:51 +0000 (18:27 +0900)
committerHiroaki KAWAI <hiroaki.kawai@gmail.com>
Tue, 8 May 2012 01:02:19 +0000 (10:02 +0900)
In daemon_loop, db.commit() is required to fetch
updated network status. Without this, ports are
stick to DEAD_VLAN_TAG.

Change-Id: I1a951d60eb75384676309e8db29ea7baa48055bc

quantum/plugins/openvswitch/agent/ovs_quantum_agent.py

index a01289d731f62dd3081181fa444f2792d896cc00..f1a41fced92c6faf6c6b2161332f03ce2b42b61b 100755 (executable)
@@ -640,6 +640,14 @@ class OVSQuantumTunnelAgent(object):
 
             old_vif_ports = new_vif_ports
             old_local_bindings = new_local_bindings
+            try:
+                db.commit()
+            except Exception as e:
+                LOG.info("Unable to commit to database! Exception: %s" % e)
+                db.rollback()
+                old_local_bindings = {}
+                old_vif_ports = {}
+
             time.sleep(self.polling_interval)