andreaturli commented on this pull request.


>        if (templateOptions.getKeyPairName() != null) {
          options.keyPairName(templateOptions.getKeyPairName());
-         KeyPair keyPair = 
keyPairCache.getIfPresent(RegionAndName.fromRegionAndName(template.getLocation().getId(),
 templateOptions.getKeyPairName()));
-         if (keyPair != null && keyPair.getPrivateKey() != null) {
-            privateKey = Optional.of(keyPair.getPrivateKey());
-            credentialsBuilder.privateKey(privateKey.get());
-         }

right! 
I've re-added same logic in 
`ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet`
thanks!

Tested with
```
               templateOptions.generateKeyPair(true);
```
and with
```
               templateOptions.keyPairName("test");
               String privateKey = Files.toString(new 
File("/Users/andrea/Downloads/test.pem"), Charsets.UTF_8);
               templateOptions.overrideLoginPrivateKey(privateKey);
```
looks good to me

-- 
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/pull/1117#discussion_r127580623

Reply via email to