> @@ -94,6 +97,12 @@ public boolean apply(FloatingIP arg0) {
>           // try to prevent multiple parallel launches from choosing the same 
> ip.
>           Collections.shuffle(unassignedIps);
>           ip = Iterables.getLast(unassignedIps);
> +         
> +         //if we are still unable to allocate IP, even after iterating 
> through all 
> +         //available, then re-throw IRE as there is nothing left we can do
> +         if(ip == null){
> +         throw new InsufficientResourcesException("Failed to allocate a 
> FloatingIP for node(" + node.getId() + ")",e);
> +         }
>        }
>        logger.debug(">> adding floatingIp(%s) to node(%s)", ip.getIp(), 
> node.getId());

In both cases, when falling back to the list because of the `null` or the IRE, 
I'd end up throwing an IRE if no ip could be allocated. I assume the NPE was an 
issue and that it should never got propagated, so I'd throw the IRE if no ip 
can be allocated, regardless of the cause (404 or 400).

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/425/files#r14414233

Reply via email to