>     protected String imageIdForZone(String zoneId) {
>        ImageApi imageApi = api.getImageApiForZone(zoneId);
> -      return Iterables.getLast(imageApi.list().concat()).getId();
> +      return Iterables.getFirst(imageApi.list().concat(), null).getId();

Yes. The "lighter" images tend to be first in image lists and "heavier" images 
last. We want light images that start quickly so we take the first.

No. That `null` only gets returned if there are no images at all. And if there 
are no images at all  your hosed anyway. I've never understood why Guava 
Iterables has a getLast(Iterable, T defaultValue) and getLast(Iterable) throws 
NoSuchElementException but only getFirst(Iterable, T defaultValue) 

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

Reply via email to