]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Delete floating port and floatingip in the same transaction
authorgongysh <gongysh@cn.ibm.com>
Mon, 19 Nov 2012 02:00:01 +0000 (10:00 +0800)
committergongysh <gongysh@cn.ibm.com>
Mon, 19 Nov 2012 02:00:01 +0000 (10:00 +0800)
Bug #1080516

Change-Id: Icb5b71e29af582cb0e381e22909f46b325063d71

quantum/db/l3_db.py

index 1886ead0b72cee336d4de08301ee42848bb97647..035f10b6d23c4512f4e6bacbc5d3f358541a7623 100644 (file)
@@ -606,9 +606,9 @@ class L3_NAT_db_mixin(l3.RouterPluginBase):
         floatingip = self._get_floatingip(context, id)
         with context.session.begin(subtransactions=True):
             context.session.delete(floatingip)
-        self.delete_port(context.elevated(),
-                         floatingip['floating_port_id'],
-                         l3_port_check=False)
+            self.delete_port(context.elevated(),
+                             floatingip['floating_port_id'],
+                             l3_port_check=False)
 
     def get_floatingip(self, context, id, fields=None):
         floatingip = self._get_floatingip(context, id)