From: Akihiro MOTOKI Date: Tue, 11 Sep 2012 04:44:57 +0000 (+0900) Subject: Remove an external port when an error occurs during FIP creation. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=aa100f9f661a91f88f9ebc24a5b91a368032a81d;p=openstack-build%2Fneutron-build.git Remove an external port when an error occurs during FIP creation. Fixes bug 1048140 To remove an external port, we need to use the same context used when it is created. Change-Id: Ia89b086b420741e7e0e92625b62e46fcfe9dbbba --- diff --git a/quantum/db/l3_db.py b/quantum/db/l3_db.py index 980fb0e5d..1c6707c2c 100644 --- a/quantum/db/l3_db.py +++ b/quantum/db/l3_db.py @@ -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)