> + logger.info("Image %s not found in the image cache. Trying to get it
> from the provider...", imageId);
> + // Note that this will generate make a call to the provider instead of
> using a cache, but
> + // this will be executed rarely, only when an image is not present in
> the image list but
> + // it actually exists in the provider. It shouldn't be an expensive
> call so using a cache just for
> + // this corner case is overkill.
> + Image imageFromProvider = getImageStrategy.getImage(imageId);
> + if (imageFromProvider == null) {
> + throwNoSuchElementExceptionAfterLoggingImageIds(format("%s not
> found", idPredicate), images);
> + }
> + // Register the just found image in the image cache, so subsequent
> uses of the TemplateBuilder and
> + // the ComptueService find it.
> + this.images.registerImage(imageFromProvider);
> + return imageFromProvider;
> + }
> +
> +}
The reason of this duplication is for use for the overridden method
<code>build()</code>. Because of <a
href="https://issues.apache.org/jira/browse/JCLOUDS-482">JCLOUDS-482</a>, I had
to bypass the <code>resolveHardware()</code> of the default implementation.
With that said, I'll just change the visibility of those methods in my PR.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/72/files#r17345449