brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request: Fix JcloudsLocation.resumeMachine wh...
Date Thu, 05 May 2016 17:56:25 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/116#discussion_r62226135
  
    --- Diff: locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
---
    @@ -2133,11 +2133,17 @@ protected NodeMetadata findNodeOrThrow(ConfigBag config) {
             }
             NodeMetadata node = Iterables.getOnlyElement(candidateNodes);
     
    -        String pkd = LocationConfigUtils.getOsCredential(config).checkNoErrors().logAnyWarnings().getPrivateKeyData();
    +        OsCredential osCredentials = LocationConfigUtils.getOsCredential(config).checkNoErrors().logAnyWarnings();
    +        String pkd = osCredentials.getPrivateKeyData();
    +        String password = osCredentials.getPassword();
             if (Strings.isNonBlank(pkd)) {
                 LoginCredentials expectedCredentials = LoginCredentials.fromCredentials(new
Credentials(user, pkd));
                 //override credentials
                 node = NodeMetadataBuilder.fromNodeMetadata(node).credentials(expectedCredentials).build();
    +        } else if (Strings.isNonBlank(password)) {
    +            LoginCredentials expectedCredentials = LoginCredentials.fromCredentials(new
Credentials(user, password));
    +            //override credentials
    +            node = NodeMetadataBuilder.fromNodeMetadata(node).credentials(expectedCredentials).build();
             }
     
             return node;
    --- End diff --
    
    I'm going to leave as-is because there is an implicit third case (where neither if block
matches). In that case, we don't override the node's credentials (so use whatever the compute-service
gave us). I suspect that will not have credentials at all.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message