> @@ -89,6 +93,13 @@ public NodeMetadata apply(VirtualGuest from) {
>           
> builder.publicAddresses(ImmutableSet.of(from.getPrimaryIpAddress()));
>        if (from.getPrimaryBackendIpAddress() != null)
>           
> builder.privateAddresses(ImmutableSet.of(from.getPrimaryBackendIpAddress()));
> +      // TODO simplify once we move domain classes to AutoValue
> +      if (from.getOperatingSystem() != null && 
> from.getOperatingSystem().getPasswords() != null && 
> !from.getOperatingSystem().getPasswords().isEmpty()) {
> +         Password password = 
> Iterables.getOnlyElement(from.getOperatingSystem().getPasswords());
> +         if (password != null) {

This will never be null, as the `getOnlyElement` will fail if it is empty or 
has more than one element.

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

Reply via email to