Fix For Bug #335 78/4978/3
authorgoyal <sheena.goyal@tcs.com>
Tue, 28 Jan 2014 10:54:31 +0000 (16:24 +0530)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 29 Jan 2014 05:13:27 +0000 (05:13 +0000)
Bug Description : Remove SW2 property "description" to a node - not working for both OF13 and OF10 mininet.

Change-Id: Iaa3667d7ca6aa4f27d024d2cfe435b08c1d359f2
Signed-off-by: goyal <sheena.goyal@tcs.com>
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java

index 770180c04e7ae754e91d12659ae43ea2577a3d4b..e8104b5647f430d238b758b0ad283a42fc2f5b31 100644 (file)
@@ -839,9 +839,14 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
             String prop = entry.getKey();
             if (!updateProperties.containsKey(prop)) {
                 if (prop.equals(Description.propertyName)) {
-                    if (!advertisedDesc.isEmpty()) {
-                        Property desc = new Description(advertisedDesc);
-                        propMap.put(Description.propertyName, desc);
+                    if (advertisedDesc != null) {
+                        if (!advertisedDesc.isEmpty()) {
+                            Property desc = new Description(advertisedDesc);
+                            propMap.put(Description.propertyName, desc);
+                        }
+                    }
+                    else {
+                        propMap.remove(prop);
                     }
                     continue;
                 } else if (prop.equals(ForwardingMode.name)) {