From 4c64c174c47dfa74d66632956ac8d06e030c842b Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Fri, 2 Nov 2012 11:17:25 +0800 Subject: [PATCH] Clean-up comments in quantum/db/l3_db.py Change-Id: I85eaedca8b428ac7ba31f7aa088acb3c21129381 --- quantum/db/l3_db.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/quantum/db/l3_db.py b/quantum/db/l3_db.py index 66fcbd8c0..1c3a2fcd6 100644 --- a/quantum/db/l3_db.py +++ b/quantum/db/l3_db.py @@ -536,11 +536,11 @@ class L3_NAT_db_mixin(l3.RouterPluginBase): msg = "Network %s is not a valid external network" % f_net_id raise q_exc.BadRequest(resource='floatingip', msg=msg) - # This external port is never exposed to the tenant. - # it is used purely for internal system and admin use when - # managing floating IPs. try: with context.session.begin(subtransactions=True): + # This external port is never exposed to the tenant. + # it is used purely for internal system and admin use when + # managing floating IPs. external_port = self.create_port(context.elevated(), { 'port': {'tenant_id': '', # tenant intentionally not set @@ -554,7 +554,6 @@ class L3_NAT_db_mixin(l3.RouterPluginBase): # Ensure IP addresses are allocated on external port if not external_port['fixed_ips']: msg = "Unable to find any IP address on external network" - # remove the external port raise q_exc.BadRequest(resource='floatingip', msg=msg) floating_fixed_ip = external_port['fixed_ips'][0] @@ -579,7 +578,6 @@ class L3_NAT_db_mixin(l3.RouterPluginBase): raise except Exception: LOG.exception("Floating IP association failed") - # Remove the port created for internal purposes raise return self._make_floatingip_dict(floatingip_db) -- 2.45.2