X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnorthbound%2Fnetworkconfiguration%2Fneutron%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetworkconfig%2Fneutron%2Fnorthbound%2FNeutronFloatingIPsNorthbound.java;h=af7cfd18b98376cd712b8a747f37c62d1a1e476d;hp=f93191220b407b43080595edfff2f771d7160aa4;hb=085713d3e52264d57398e07e55b6abed9dbdc980;hpb=4b5f54e25c08fc21c955ff75901abe96b12d3340 diff --git a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java index f93191220b..af7cfd18b9 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java +++ b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFloatingIPsNorthbound.java @@ -203,7 +203,7 @@ public class NeutronFloatingIPsNorthbound { // if floating IP is specified, make sure it can come from the network String floatingIP = singleton.getFloatingIPAddress(); if (floatingIP != null) { - if (externNetwork.getSubnets().size() > 1) + if (externNetwork.getSubnets().size() != 1) throw new BadRequestException("external network doesn't have a subnet"); NeutronSubnet externSubnet = subnetInterface.getSubnet(externNetwork.getSubnets().get(0)); if (!externSubnet.isValidIP(floatingIP)) @@ -312,7 +312,7 @@ public class NeutronFloatingIPsNorthbound { if (!input.isSingleton()) throw new BadRequestException("only singleton requests allowed."); NeutronFloatingIP singleton = input.getSingleton(); - if (singleton.getID() != null) + if (singleton.getID() == null) throw new BadRequestException("singleton UUID doesn't exist."); NeutronNetwork externNetwork = networkInterface.getNetwork( @@ -321,7 +321,7 @@ public class NeutronFloatingIPsNorthbound { // if floating IP is specified, make sure it can come from the network String floatingIP = singleton.getFloatingIPAddress(); if (floatingIP != null) { - if (externNetwork.getSubnets().size() > 1) + if (externNetwork.getSubnets().size() != 1) throw new BadRequestException("external network doesn't have a subnet."); NeutronSubnet externSubnet = subnetInterface.getSubnet(externNetwork.getSubnets().get(0)); if (!externSubnet.isValidIP(floatingIP))