andreaturli commented on this pull request.
> + } + }); + return floatingIPOptional; + } + + private org.jclouds.openstack.neutron.v2.domain.FloatingIP createFloatingIpUsingNeutron(org.jclouds.openstack.neutron.v2.features.FloatingIPApi neutronFloatingApi, NodeMetadata node, final String availabilityZone) { + String regionId = node.getLocation().getParent().getId(); + + Optional<Network> networkOptional = getNetworkApi(regionId).list().concat().firstMatch(new Predicate<Network>() { + @Override + public boolean apply(@Nullable Network input) { + return input.getExternal() && input.getAvailabilityZone().equals(availabilityZone); + } + }); + if (!networkOptional.isPresent()) + throw new InsufficientResourcesException("Failed to find a suitable external network."); good point! as poolnames are optional, what shall we do if poolnames is empty? fail seems reasonable as we try to re-use an existing floating ip and to create from a poolname: if no poolnames are specified we can't infer much, right? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1178#discussion_r168449593