jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds] [SoftLayer] fix some failing LiveTests (#838)
Date Mon, 10 Aug 2015 20:47:00 GMT
> @@ -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
Mime
View raw message