> @@ -727,12 +731,21 @@ public Template build() {
>     }
>  
>     private Image findImageWithId(Set<? extends Image> images) {
> -      Image image;
> -      // TODO: switch to GetImageStrategy in version 1.5
> -      image = tryFind(images, idPredicate).orNull();
> -      if (image == null)
> -         throwNoSuchElementExceptionAfterLoggingImageIds(format("%s not 
> found", idPredicate), images);
> -      return image;
> +      // Try find the image in the cache and fallback to the GetImageStrategy
> +      // see https://issues.apache.org/jira/browse/JCLOUDS-570
> +      Optional<? extends Image> image = tryFind(images, idPredicate);
> +      if (!image.isPresent()) {
> +         logger.warn("Image %s not found in the image cache. Trying to get 
> it directly...", imageId);
> +         // Note that this might generate make a call to the provider 
> instead of using a cache, but

[minor] "Note that this will generate a call..."?

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

Reply via email to