From: armando-migliaccio Date: Mon, 27 Jan 2014 22:05:12 +0000 (-0800) Subject: Fix error while connecting to busy NSX L2 Gateway X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5b5fff260bb83943d7dc9987645623edd5cdb03d;p=openstack-build%2Fneutron-build.git Fix error while connecting to busy NSX L2 Gateway Ensure that a Conflict error is properly handled. Change-Id: Ib468ee953aef0fc54ea88064f88637ed46bc6352 Closes-bug: 1270724 --- diff --git a/neutron/plugins/nicira/NeutronPlugin.py b/neutron/plugins/nicira/NeutronPlugin.py index 26edc9b8c..32ee011eb 100644 --- a/neutron/plugins/nicira/NeutronPlugin.py +++ b/neutron/plugins/nicira/NeutronPlugin.py @@ -2009,8 +2009,11 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin, network_mapping_info): # Ensure the default gateway in the config file is in sync with the db self._ensure_default_network_gateway() - return super(NvpPluginV2, self).connect_network( - context, network_gateway_id, network_mapping_info) + try: + return super(NvpPluginV2, self).connect_network( + context, network_gateway_id, network_mapping_info) + except NvpApiClient.Conflict: + raise nvp_exc.NvpL2GatewayAlreadyInUse(gateway=network_gateway_id) def disconnect_network(self, context, network_gateway_id, network_mapping_info):