]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
pass default l3_gateway_service_uuid if not specified
authorAaron Rosen <arosen@nicira.com>
Thu, 12 Sep 2013 19:42:29 +0000 (12:42 -0700)
committerAaron Rosen <arosen@nicira.com>
Thu, 12 Sep 2013 19:42:29 +0000 (12:42 -0700)
Previously, if one created an external network of type l3_ext and did
not specify the default_gw_service_uuid via --provider:physical_network
an exception would be raised on the backend as we need to specify the
l3_gw_service_uuid we want nvp to use.

Fixes bug: 1224660

Change-Id: I6312956528c17d6a704d4e4ef629916f6463312a

neutron/plugins/nicira/NeutronPlugin.py

index 2b4ec1bf89e2ca8cb8e019aa2cc2af79d6658a5c..c161668e33d682afa5271a31944e26a255fcb947 100644 (file)
@@ -622,11 +622,13 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin,
         ext_network = self.get_network(context, port_data['network_id'])
         if ext_network.get(pnet.NETWORK_TYPE) == NetworkTypes.L3_EXT:
             # Update attachment
+            physical_network = (ext_network[pnet.PHYSICAL_NETWORK] or
+                                self.cluster.default_l3_gw_service_uuid)
             self._update_router_port_attachment(
                 self.cluster, context, router_id, port_data,
                 lr_port['uuid'],
                 "L3GatewayAttachment",
-                ext_network[pnet.PHYSICAL_NETWORK],
+                physical_network,
                 ext_network[pnet.SEGMENTATION_ID])
 
         LOG.debug(_("_nvp_create_ext_gw_port completed on external network "