> @@ -117,8 +118,11 @@ public NodeMetadata apply(final Deployment from) {
>        // TODO: CloudService name is required (see JCLOUDS-849): waiting for 
> JCLOUDS-853.
>        final CloudService cloudService = 
> api.getCloudServiceApi().get(from.name());
>        if (cloudService != null) {
> +         final String location = cloudService.location() != null
> +                 ? cloudService.location()
> +                 : 
> api.getAffinityGroupApi().get(cloudService.affinityGroup()).location();

The affinityGroup field is also marked `@Nullable`, is it always present when 
the location field is missing?
Also, the AffinityGroupApi.get method returns null if the affinity group is not 
found. Should we protect the code against this case?

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

Reply via email to