jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds/jclouds] [JCLOUDS-1382] improve usage of Neutron capabilities from Nova (#1178)
Date Thu, 15 Feb 2018 11:45:32 GMT
nacx 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.");

If pool names is empty I'd say it is ok to pick the first external network we find.  We should
add proper logs about the network we are selecting.

-- 
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_r168451725
Mime
View raw message