> @@ -270,9 +275,31 @@ public CloudStackComputeServiceAdapter(CloudStackApi 
> client, Predicate<String> j
>  
>     @Override
>     public Iterable<Template> listImages() {
> -      // TODO: we may need to filter these further
> -      // we may also want to see if we can work with ssh keys
> -      return filter(client.getTemplateApi().listTemplates(), isReady());
> +      Set<String> projects = 
> ImmutableSet.copyOf(transform(projectSupplier.get().values(),
> +              new Function<Project, String>() {
> +
> +                 @Override
> +                 public String apply(Project project) {
> +                    return project.getId();
> +                 }
> +              }));
> +
> +      return filter(concat(transform(ImmutableSet.<String> 
> builder().addAll(projects).add("").build(),

Any reason for all these immutable sets and builders here? How about just 
making `projects` a `newHashMap`, then simply adding `""` and transforming that?

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

Reply via email to