Bug 7601: Cleanup Elan instances when a network is deleted 73/50673/4
authorSridhar Gaddam <sgaddam@redhat.com>
Thu, 19 Jan 2017 14:45:14 +0000 (20:15 +0530)
committerAlon Kochba <alonko@hpe.com>
Tue, 31 Jan 2017 15:00:43 +0000 (15:00 +0000)
The following patch in Neutron[1] modifies the Network delete sequence.
Prior to a network delete event, we now see an update event that removes
the networkType. So, in delete event, when we try to check for the
networkType, it would be empty and there is an exception. Because of this,
elanInstances are not getting deleted. In this patch, we avoid the check
for networkType since the network itself would not be created in the first
place if its not a supported networkType.

[1] https://review.openstack.org/#/c/317358/

Change-Id: I349a51f4df666ef2c2912ee552f159b6af16de76
Signed-off-by: Sridhar Gaddam <sgaddam@redhat.com>
vpnservice/neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronNetworkChangeListener.java

index efc7b8bfe5ee23e1d1c6dda1e3b2f3c4285c3491..fcc2b6bec670a1e56c3b63633d0cbfb35cef7aba 100644 (file)
@@ -99,11 +99,6 @@ public class NeutronNetworkChangeListener extends AsyncDataTreeChangeListenerBas
     @Override
     protected void remove(InstanceIdentifier<Network> identifier, Network input) {
         LOG.trace("Removing Network : key: {}, value={}", identifier, input);
-        if (!NeutronvpnUtils.isNetworkTypeSupported(input)) {
-            //FIXME: This should be removed when support for GRE network types is added
-            LOG.error("Neutronvpn doesn't support gre network provider type for this network {}.", input);
-            return;
-        }
         if (NeutronvpnUtils.getIsExternal(input)) {
             if (NeutronvpnUtils.isFlatOrVlanNetwork(input)) {
                 nvpnManager.removeExternalVpnInterfaces(input.getUuid());