Cleanup errors for networks of unsupported type 72/52072/6
authorAlon Kochba <alonko@hpe.com>
Mon, 20 Feb 2017 13:21:20 +0000 (15:21 +0200)
committerVivekanandan Narasimhan <n.vivekanandan@ericsson.com>
Mon, 27 Feb 2017 06:45:54 +0000 (06:45 +0000)
Reword and lower debug level of network configurations
for networks without a provider extension or with an
unsupported type.

Change-Id: I3b58a79b2fb72fe2c56328f79e0962e366a299ff
Signed-off-by: Alon Kochba <alonko@hpe.com>
Signed-off-by: Sam Hague <shague@redhat.com>
vpnservice/neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronPortChangeListener.java
vpnservice/neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronSubnetChangeListener.java
vpnservice/neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronvpnUtils.java

index 934286b820ca5db72a04261cdcf0fcb1e9ae93d3..e10e0736ea5f03f823a6df6bd7300931dd7b3c1c 100644 (file)
@@ -106,9 +106,9 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
         LOG.trace("Adding Port : key: {}, value={}", identifier, input);
         Network network = NeutronvpnUtils.getNeutronNetwork(dataBroker, input.getNetworkId());
         if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) {
-            //FIXME: This should be removed when support for VLAN and GRE network types is added
-            LOG.error("neutron vpn doesn't support vlan/gre network provider type for the port {} which is part of "
-                + "network {}.", portName, network);
+            LOG.warn("neutron vpn received a port add() for a network without a provider extension augmentation "
+                            + "or with an unsupported network type for the port {} which is part of network {}",
+                    portName, network);
             return;
         }
         NeutronvpnUtils.addToPortCache(input);
@@ -143,9 +143,10 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
         LOG.trace("Removing Port : key: {}, value={}", identifier, input);
         Network network = NeutronvpnUtils.getNeutronNetwork(dataBroker, input.getNetworkId());
         if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) {
-            //FIXME: This should be removed when support for VLAN and GRE network types is added
-            LOG.error("neutron vpn doesn't support vlan/gre network provider type for the port {} which is part of "
-                + "network {}.", input.getUuid().getValue(), network);
+            String portName = input.getUuid().getValue();
+            LOG.warn("neutron vpn received a port remove() for a network without a provider extension augmentation "
+                            + "or with an unsupported network type for the port {} which is part of network {}",
+                    portName, network);
             return;
         }
         NeutronvpnUtils.removeFromPortCache(input);
@@ -174,8 +175,9 @@ public class NeutronPortChangeListener extends AsyncDataTreeChangeListenerBase<P
         LOG.trace("Updating Port : key: {}, original value={}, update value={}", identifier, original, update);
         Network network = NeutronvpnUtils.getNeutronNetwork(dataBroker, update.getNetworkId());
         if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) {
-            LOG.error("neutron vpn doesn't support vlan/gre network provider type for the port {} which is part of "
-                + "network {}. Skipping the processing of Port update DCN", portName, network);
+            LOG.warn("neutron vpn received a port update() for a network without a provider extension augmentation "
+                    + "or with an unsupported network type for the port {} which is part of network {}",
+                    portName, network);
             return;
         }
         NeutronvpnUtils.addToPortCache(update);
index e7fd68e5af9aa4d28cc3a81b65a49decbc6a8dbc..7e5742fe3fd17d210100673edef159719c65856f 100644 (file)
@@ -71,10 +71,9 @@ public class NeutronSubnetChangeListener extends AsyncDataTreeChangeListenerBase
         Uuid subnetId = input.getUuid();
         Network network = NeutronvpnUtils.getNeutronNetwork(dataBroker, networkId);
         if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) {
-            //FIXME: This should be removed when support for VLAN and GRE network types is added
-            LOG.error("neutron vpn doesn't support vlan/gre network provider type for the port {} "
-                + "which is part of network {}."
-                + " Skipping the processing of Subnet add DCN", input.getName(), network);
+            LOG.warn("neutron vpn received a subnet add() for a network without a provider extension augmentation "
+                            + "or with an unsupported network type for the subnet {} which is part of network {}",
+                    input.getUuid().getValue(), network);
             return;
         }
 
@@ -99,10 +98,9 @@ public class NeutronSubnetChangeListener extends AsyncDataTreeChangeListenerBase
         Uuid subnetId = input.getUuid();
         Network network = NeutronvpnUtils.getNeutronNetwork(dataBroker, networkId);
         if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) {
-            //FIXME: This should be removed when support for GRE network types is added
-            LOG.error("neutron vpn doesn't support gre network provider type for the port {} "
-                + "which is part of network {}."
-                + " Skipping the processing of Subnet remove DCN", input.getName(), network);
+            LOG.warn("neutron vpn received a subnet remove() for a network without a provider extension augmentation "
+                            + "or with an unsupported network type for the subnet {} which is part of network {}",
+                    input.getUuid().getValue(), network);
             return;
         }
 
@@ -126,9 +124,9 @@ public class NeutronSubnetChangeListener extends AsyncDataTreeChangeListenerBase
         Uuid subnetId = update.getUuid();
         Network network = NeutronvpnUtils.getNeutronNetwork(dataBroker, networkId);
         if (network == null || !NeutronvpnUtils.isNetworkTypeSupported(network)) {
-            LOG.error("neutron vpn doesn't support vlan/gre network provider type for the port {} "
-                + "which is part of network {}."
-                + " Skipping the processing of Subnet update DCN", update.getName(), network);
+            LOG.warn("neutron vpn received a subnet update() for a network without a provider extension augmentation "
+                            + "or with an unsupported network type for the subnet {} which is part of network {}",
+                    update.getUuid().getValue(), network);
             return;
         }
 
index c806adb13a8ac96d6c113cf217da49606429e5a1..455432927d10103d5d709f06715e230bca4c196f 100644 (file)
@@ -1017,11 +1017,6 @@ public class NeutronvpnUtils {
         return result;
     }
 
-    static boolean isNetworkTypeSupported(Network network) {
-        NetworkProviderExtension npe = network.getAugmentation(NetworkProviderExtension.class);
-        return npe != null && npe.getNetworkType() != null && SUPPORTED_NETWORK_TYPES.contains(npe.getNetworkType());
-    }
-
     static ProviderTypes getProviderNetworkType(Network network) {
         if (network == null) {
             LOG.error("Error in getting provider network type since network is null");
@@ -1045,6 +1040,11 @@ public class NeutronvpnUtils {
         return null;
     }
 
+    static boolean isNetworkTypeSupported(Network network) {
+        NetworkProviderExtension npe = network.getAugmentation(NetworkProviderExtension.class);
+        return npe != null && npe.getNetworkType() != null && SUPPORTED_NETWORK_TYPES.contains(npe.getNetworkType());
+    }
+
     static boolean isNetworkOfType(Network network, Class<? extends NetworkTypeBase> type) {
         NetworkProviderExtension npe = network.getAugmentation(NetworkProviderExtension.class);
         return npe != null && npe.getNetworkType() != null && type.isAssignableFrom(npe.getNetworkType());