X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fswitchmanager%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fswitchmanager%2Finternal%2FSwitchManagerImpl.java;h=a91edb0c25a8f437f737f4e379f921463a3b385a;hp=5d10620c4403f8c00829bd02927d5da39fa07178;hb=refs%2Fchanges%2F80%2F780%2F1;hpb=5db7ed90dcf16bf3d533befd238020805d28b426 diff --git a/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerImpl.java b/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerImpl.java index 5d10620c44..a91edb0c25 100644 --- a/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerImpl.java +++ b/opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerImpl.java @@ -702,7 +702,7 @@ CommandProvider { if (mode != null) { if (isDefaultContainer) { if (!mode.isValid()) { - return new Status(StatusCode.NOTACCEPTABLE, "Invalid Forwarding Mode Value."); + return new Status(StatusCode.BADREQUEST, "Invalid Forwarding Mode Value."); } } else { return new Status(StatusCode.NOTACCEPTABLE, @@ -744,10 +744,10 @@ CommandProvider { } Node node = Node.fromString(nodeId); Map propMapCurr = nodeProps.get(node); - Map propMap = new HashMap(propMapCurr); if (propMapCurr == null) { return new Status(StatusCode.SUCCESS); } + Map propMap = new HashMap(propMapCurr); if (!prevNodeProperties.isEmpty()) { for (String prop : prevNodeProperties.keySet()) { if (!updateProperties.containsKey(prop)) { @@ -820,7 +820,6 @@ CommandProvider { spanConfigList), spanFileName); retS = objWriter.write(new ConcurrentHashMap( nodeConfigList), switchConfigFileName); - if (retS.equals(retP)) { if (retS.isSuccess()) { return retS; @@ -936,7 +935,6 @@ CommandProvider { } else { result = nodeProps.replace(node, propMapCurr, propMap); } - if (!result) { log.debug("Cluster conflict: Conflict while adding the node properties. Node: {} Properties: {}", node.getID(), props); @@ -981,7 +979,15 @@ CommandProvider { : new HashMap(propMapCurr); // copy node properties from plugin + String nodeId = node.toString(); for (Property prop : props) { + if (nodeConfigList != null) { + SwitchConfig conf = nodeConfigList.get(nodeId); + if (conf != null && (conf.getNodeProperties() != null) + && conf.getNodeProperties().containsKey(prop.getName())) { + continue; + } + } propMap.put(prop.getName(), prop); }