Merge "Revert "BUG 2594 - PUT method returns wrong status on create""
authorTony Tkacik <ttkacik@cisco.com>
Fri, 8 Jan 2016 09:12:08 +0000 (09:12 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 8 Jan 2016 09:12:08 +0000 (09:12 +0000)
opendaylight/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfImpl.java

index 5356e75e460eef46fefc2aee69a7240e4a270a66..bc2d23cd70f052cde95e2a304b40f1786a626b70 100644 (file)
@@ -717,14 +717,11 @@ public class RestconfImpl implements RestconfService {
          * document the behavior).
          */
         int tries = 2;
-        Status status = Status.NOT_MODIFIED;
         while(true) {
             try {
                 if (mountPoint != null) {
-                    status = broker.readConfigurationData(mountPoint, normalizedII) != null ? Status.OK : Status.CREATED;
                     broker.commitConfigurationDataPut(mountPoint, normalizedII, payload.getData()).checkedGet();
                 } else {
-                    status = broker.readConfigurationData(normalizedII) != null ? Status.OK : Status.CREATED;
                     broker.commitConfigurationDataPut(controllerContext.getGlobalSchema(), normalizedII, payload.getData()).checkedGet();
                 }
 
@@ -748,7 +745,7 @@ public class RestconfImpl implements RestconfService {
             }
         }
 
-        return Response.status(status).build();
+        return Response.status(Status.OK).build();
     }
 
     private static void validateTopLevelNodeName(final NormalizedNodeContext node,