From aa100f9f661a91f88f9ebc24a5b91a368032a81d Mon Sep 17 00:00:00 2001 From: Akihiro MOTOKI Date: Tue, 11 Sep 2012 13:44:57 +0900 Subject: [PATCH] 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 --- quantum/db/l3_db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.45.2