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%2FNeutronRoutersNorthbound.java;h=0c02adad8a0d4d4ddf499efca66d39b05aff513c;hp=17b2fcfcf9ef43437903f499dc4da2aceb61983b;hb=4f86ec1a7c51b28d066bcd34b7cb47cfed7eff1e;hpb=04112a9b9591ef8d2e68694fe7ed3a771efd2960 diff --git a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java index 17b2fcfcf9..0c02adad8a 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java +++ b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronRoutersNorthbound.java @@ -422,7 +422,9 @@ public class NeutronRoutersNorthbound { if (instances != null) { for (Object instance : instances) { INeutronRouterAware service = (INeutronRouterAware) instance; - service.canAttachInterface(target, input); + int status = service.canAttachInterface(target, input); + if (status < 200 || status > 299) + return Response.status(status).build(); } } @@ -498,7 +500,9 @@ public class NeutronRoutersNorthbound { if (instances != null) { for (Object instance : instances) { INeutronRouterAware service = (INeutronRouterAware) instance; - service.canDetachInterface(target, input); + int status = service.canDetachInterface(target, input); + if (status < 200 || status > 299) + return Response.status(status).build(); } } @@ -523,6 +527,9 @@ public class NeutronRoutersNorthbound { if (input.getPortUUID() != null && input.getSubnetUUID() == null) { NeutronRouter_Interface targetInterface = target.getInterfaces().get(input.getPortUUID()); + if (targetInterface == null) { + throw new ResourceNotFoundException("Router interface not found for given Port UUID"); + } input.setSubnetUUID(targetInterface.getSubnetUUID()); input.setID(target.getID()); input.setTenantID(target.getTenantID()); @@ -550,7 +557,7 @@ public class NeutronRoutersNorthbound { throw new ResourceNotFoundException("Port UUID not found"); } if (port.getFixedIPs() == null) { - throw new ResourceNotFoundException("Port UUID jas no fixed IPs"); + throw new ResourceNotFoundException("Port UUID has no fixed IPs"); } NeutronSubnet subnet = subnetInterface.getSubnet(input.getSubnetUUID()); if (subnet == null) {