Thanks @devcsrj!
>The part left I'm not sure of is my use of `@Named("DEFAULT2")` here. There
>seems to be a prettier approach.
Having a look at the method, I don't really get why you need to override it
(and I think you shouldn't). The TemplateBuilderSpec already considers the
"locationId" property, so there is no need to provide a separate property to
configure it to be taken into account to configure the default template (to be
used if none is provided when calling the createNodes method).
Also, there is no need to explicitly returning the first Datacenter, as the
tempalte builder will fallback to the [default
location](https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/domain/internal/TemplateBuilderImpl.java#L700-L703)
if none is provided. That default location supplier is configured by the
[ImplicitLocationSupplier](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/location/suppliers/ImplicitLocationSupplier.java),
which default implementation returns the first region or zone.
The default jclouds behaviour should cover what you are trying to do by
overriding this method, if I have understood it properly. Does this make sense?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/145#issuecomment-115007146