> return > Objects.firstNonNull(api.getImageApiForProject(userProject.get()).get(id), > - > Objects.firstNonNull(api.getImageApiForProject(DEBIAN_PROJECT).get(id), > - > api.getImageApiForProject(CENTOS_PROJECT).get(id))); > - > + Iterables.tryFind(listImages(), new Predicate<Image>() { > + @Override > + public boolean apply(Image input) { > + return input.getName().equalsIgnoreCase(id); > + }
@demobox I think it could be more expensive but my idea was to take advantage of the fact that the result of listImages gets cached and so this is quite inexpensive. But I'm happy to revert the impl if you think I'm not understanding correctly the behaviour. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-google/pull/23/files#r11559174