> @@ -149,8 +148,18 @@ public boolean apply(final String name) {
>        final VMDeployment deployment = deployments.iterator().next();
>  
>  
> -      return new NodeAndInitialCredentials<VMDeployment>(deployment, name,
> -              
> LoginCredentials.builder().user(loginUser).identity(loginUser).password(loginPassword).authenticateSudo(true).build());
> +      NodeAndInitialCredentials<VMDeployment> credential = null;
> +
> +      if (template.getOptions().getPublicKey() != null){
> +         String privateKey = template.getOptions().getPrivateKey();
> +         credential = new 
> NodeAndInitialCredentials<VMDeployment>(deployment, name,
> +                 
> LoginCredentials.builder().user(loginUser).privateKey(privateKey).authenticateSudo(true).build());
> +      } else {
> +         credential = new 
> NodeAndInitialCredentials<VMDeployment>(deployment, name,
> +                 
> LoginCredentials.builder().user(loginUser).password(loginPassword).authenticateSudo(true).build());
> +      }

All the VM credentials configuration should be changed according to the 
proposal: https://github.com/jtjk/jclouds-labs/pull/5
This can be done in subsequent PRs, but there are important fixes to be done 
and race conditions to be removed in the actual code that are resolved there.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/291/files/8a39037237f5cccc7d100bc58a9a82bdb89924b1#r67879900

Reply via email to