Merge "Remove the unused shared network validation check as its a bit misleading"
authorSam Hague <shague@redhat.com>
Fri, 15 Apr 2016 18:00:57 +0000 (18:00 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 15 Apr 2016 18:00:57 +0000 (18:00 +0000)
openstack/net-virt/src/main/java/org/opendaylight/netvirt/openstack/netvirt/NetworkHandler.java
openstack/net-virt/src/test/java/org/opendaylight/netvirt/openstack/netvirt/NetworkHandlerTest.java

index 067c3e5b519d0ec947c5792856334c0a749e1c54..9daa5fe9aecc1ff58d93141a8e015106f6adbd1d 100644 (file)
@@ -55,11 +55,6 @@ public class NetworkHandler extends AbstractHandler implements INeutronNetworkAw
      */
     @Override
     public int canCreateNetwork(NeutronNetwork network) {
-        if (network.isShared() && !network.getRouterExternal()) {
-            LOG.error("Shared attribute is only supported on external networks");
-            return HttpURLConnection.HTTP_NOT_ACCEPTABLE;
-        }
-
         return HttpURLConnection.HTTP_OK;
     }
 
@@ -89,11 +84,6 @@ public class NetworkHandler extends AbstractHandler implements INeutronNetworkAw
     @Override
     public int canUpdateNetwork(NeutronNetwork delta,
                                 NeutronNetwork original) {
-        if (delta.isShared() && !delta.getRouterExternal()) {
-            LOG.error("Shared attribute is only supported on external networks");
-            return HttpURLConnection.HTTP_NOT_ACCEPTABLE;
-        }
-
         return HttpURLConnection.HTTP_OK;
     }
 
index eda7f44d64ca590dce87e17658da76dbe058f8b7..bf4c1f17dba41ce42f41945979112c3c046ec067 100644 (file)
@@ -74,7 +74,7 @@ public class NetworkHandlerTest {
      */
     @Test
     public void testCanCreateNetwork() {
-        assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_NOT_ACCEPTABLE, networkHandler.canCreateNetwork(sharedNeutronNetwork));
+        assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canCreateNetwork(sharedNeutronNetwork));
         assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canCreateNetwork(nonSharedNeutronNetwork));
     }
 
@@ -83,7 +83,7 @@ public class NetworkHandlerTest {
      */
     @Test
     public void testCanUpdateNetwork() {
-        assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_NOT_ACCEPTABLE, networkHandler.canUpdateNetwork(sharedNeutronNetwork, sharedNeutronNetwork));
+        assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canUpdateNetwork(sharedNeutronNetwork, sharedNeutronNetwork));
         assertEquals("Error, did not return the correct HTTP flag", HttpURLConnection.HTTP_OK, networkHandler.canUpdateNetwork(nonSharedNeutronNetwork, nonSharedNeutronNetwork));
     }