jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <notificati...@github.com>
Subject Re: [jclouds-labs] [JCLOUDS-850] Providing AzureTemplateBuilderLiveTest (#156)
Date Wed, 01 Apr 2015 13:38:38 GMT
> @@ -89,6 +89,14 @@ public void copyTo(final TemplateOptions to) {
>           if (storageAccountType.isPresent()) {
>              eTo.storageAccountType(storageAccountType.get());
>           }
> +
> +         final LoginCredentials credentials = new LoginCredentials.Builder().
> +                 user(loginUser).
> +                 password(loginPassword == null || !loginPassword.isPresent() ? null
: loginPassword.get()).
> +                 privateKey(loginPrivateKey == null || !loginPrivateKey.isPresent()
? null : loginPrivateKey.get()).
> +                 authenticateSudo(authenticateSudo == null ? false : authenticateSudo).
> +                 build();
> +         eTo.overrideLoginCredentials(credentials);

After some more investigation, it seems that without the snippet above, the original object
shows
```
  loginPassword=Optional.absent()
  loginPrivateKey=Optional.absent()
```
while `eTo`
```
  loginPassword=<null>
  loginPrivateKey=<null>
```

I believe the problem is located in [TemplateOptions around lines 89-96](https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/options/TemplateOptions.java#L89-L96)
which should be better replaced by the snippet above. Alternatively, `loginPassword` and `loginPrivateKey`
should be initialized to `Optional.absent()`.

WDYT? Shall I open an issue / PR about this and leave the fix temporarily here (in order to
keep the test case above work)?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/156/files#r27569236
Mime
View raw message