brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreaturli <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request: Fix JcloudsLocation.resumeMachine wh...
Date Wed, 20 Apr 2016 06:43:53 GMT
Github user andreaturli commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/116#discussion_r60356719
  
    --- 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();
    --- End diff --
    
    maybe you could move this out of the 'else' (and of the 'if' as well) 


---
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