]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove an external port when an error occurs during FIP creation.
authorAkihiro MOTOKI <motoki@da.jp.nec.com>
Tue, 11 Sep 2012 04:44:57 +0000 (13:44 +0900)
committerAkihiro MOTOKI <motoki@da.jp.nec.com>
Tue, 11 Sep 2012 04:55:35 +0000 (13:55 +0900)
Fixes bug 1048140

To remove an external port, we need to use the same context used
when it is created.

Change-Id: Ia89b086b420741e7e0e92625b62e46fcfe9dbbba

quantum/db/l3_db.py

index 980fb0e5d67e11189971abd982380147e229b238..1c6707c2c6c4cc63f051ddd9fe52799d1c25f79c 100644 (file)
@@ -578,7 +578,8 @@ class L3_NAT_db_mixin(l3.RouterPluginBase):
         except Exception:
             LOG.exception("Floating IP association failed")
             # Remove the port created for internal purposes
-            self.delete_port(context, external_port['id'], l3_port_check=False)
+            self.delete_port(context.elevated(), external_port['id'],
+                             l3_port_check=False)
             raise
 
         return self._make_floatingip_dict(floatingip_db)