nacx requested changes on this pull request.


> @@ -275,15 +258,24 @@ public boolean apply(Network input) {
    }
 
 
-   private List<Network> getNetworksFromPoolNames(String regionId, final 
Optional<Set<String>> poolNames) {
-      return getNetworkApi(regionId).list().concat().filter(new 
Predicate<Network>() {
-         @Override
-         public boolean apply(Network network) {
-            return poolNames.isPresent() &&
-                   !poolNames.get().isEmpty() &&
-                   poolNames.get().contains(network.getName());
+   /**
+    * Get all suitable networks to allocate a floating ip
+    *
+    * It will prefer networks specified using the poolNames first and then the 
external networks in the given availability zone
+    */
+   private List<Network> getNetworksFromPoolNamesAndExternal(String regionId, 
final String availabilityZone, final Optional<Set<String>> poolNames) {
+      if (poolNames.isPresent() && poolNames.get().isEmpty()) return 
Lists.newArrayList();

This is not OK. If the pool names are not configured you'll never try to find 
an external network.
You'll need two different methods, or a method that accepts a filtering 
predicate.

-- 
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#pullrequestreview-96886240

Reply via email to