]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Clean-up comments in quantum/db/l3_db.py
authorZhongyue Luo <zhongyue.nah@intel.com>
Fri, 2 Nov 2012 03:17:25 +0000 (11:17 +0800)
committerZhongyue Luo <zhongyue.nah@intel.com>
Fri, 2 Nov 2012 03:17:25 +0000 (11:17 +0800)
Change-Id: I85eaedca8b428ac7ba31f7aa088acb3c21129381

quantum/db/l3_db.py

index 66fcbd8c0f1c8670380aa975edc7490c6dcc4147..1c3a2fcd610c5f787b8a7b2d09867409ba95671c 100644 (file)
@@ -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)