GitHub user aledsage opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/1034

    Fix jclouds sshable

    (Unrelated to other changes, fixes 
`NetworkingUtilsTest.testIsPortAvailableReportsTrueWhenPortIsFree`).
    
    Lots of fixes to get the `JcloudsLoginLiveTest` working again.
    
    - registerJcloudsSshMachineLocation: use the userCredentials that are 
passed into the method, rather than looking up what we expect from the config.  
      (Hopefully fixes testSpecifyingPasswordAndSshKeysPrefersKeys).
    - Fix waitForSshable to when password supplied on JcloudsLocation config, 
and using useJcloudsSshInit=false.
    - Fix use of DISABLE_ROOT_AND_PASSWORD_SSH: if for root user with 
password-based login, then explicitly set PasswordAuthentication=yes.  
      If root user, then explicitly set PermitRootLogin=true
    - Fix getPublicHostnameAws so pass in the credentials (some code-paths will 
not have configured the credentials in the generic config).  
      Same for getPrivateHostnameAws.
    - Tidy up the createTemporarySshMachineLocaton
    - Logging of timing: include how long to get semaphore
    - Logging of failure: include how long for each stage
        
    Previously hit a problem when the jclouds location was configured with
    a password + a blank ssh key, and using useJcloudsSshInit=false.
    It failed to ssh to the newly provisioned AWS VM in waitForSshable. It
    got the node.getCredentials, which gives us the ssh-key from the AWS
    key-pair. But then we instantiate an SshMachineLocation to check if we
    can connection (before continuing with the user-setup). That
    machineLocation inherits the password (which has not been set on the
    machine), so it fails to ssh - the password takes precedence over the
    ssh-key.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/incubator-brooklyn 
fix/jclouds-sshable

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/1034.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1034
    
----
commit af39886a454fbadbfb9d033103a502a0b93530fb
Author: Aled Sage <[email protected]>
Date:   2015-11-05T22:21:07Z

    Improve SshMachineLocation.toString

commit 2d5a30ba9e6a10341ccb8ac513b9d57e449ae5f4
Author: Aled Sage <[email protected]>
Date:   2015-11-05T22:36:17Z

    Fix NetworkingUtilsTest.testIsPortAvailableReportsTrueWhenPortIsFree

commit 0bf42c35d6e4b50930a5f3c3a341587a48b787e5
Author: Aled Sage <[email protected]>
Date:   2015-11-09T08:13:58Z

    Adds ReachableSocketFinder
    
    Used by JcloudsLocation to determine which IP of the node is reachable.
    Previously it used the jclouds’:
        managementContext.utils().sshForNode().apply(node)
    but that fails with certain user/login configurations - e.g. when “node”
    doesn’t have login-credentials, but the JcloudsLocation.obtain knows
    about the credentials through some other configuration.
    
    Code is based on the Jclouds ConcurrentOpenSocketFinder. However, it
    is much simplified because we don’t abort-early if the VM’s status 
    goes to failed (we don’t concurrently poll the cloud-provider to find
    out the state, as jclouds was doing).

commit 6a57b26c3a4d4a6820050f9f738d87e87834aa44
Author: Aled Sage <[email protected]>
Date:   2015-11-09T08:28:56Z

    Adds TODO question to Networking.isReaachable

commit 48b5196eff9be3bb961ce0a0ba4eb87f81f52a8b
Author: Aled Sage <[email protected]>
Date:   2015-10-21T16:53:28Z

    JcloudsLoginLiveTest: run all tests in AWS
    
    The Rackspace config wasn't working (probably because image ids
    have changed).

commit e4e2bcbb15ed843b1e9b80f971e08e29f2ff4fe6
Author: Aled Sage <[email protected]>
Date:   2015-11-05T22:28:35Z

    Fix JcloudsLocation login
    
    - registerJcloudsSshMachineLocation: use the userCredentials that
      are passed into the method, rather than looking up what we expect
      from the config.
      (Hopefully fixes testSpecifyingPasswordAndSshKeysPrefersKeys).
    - Fix waitForSshable to when password supplied on JcloudsLocation
      config, and using useJcloudsSshInit=false.
    - Fix use of DISABLE_ROOT_AND_PASSWORD_SSH: if for root user with
      password-based login, then explicitly set PasswordAuthentication=yes.
      If root user, then explicitly set PermitRootLogin=true
    - Fix getPublicHostnameAws so pass in the credentials (some code-paths
      will not have configured the credentials in the generic config).
      Same for getPrivateHostnameAws.
    - Tidy up the createTemporarySshMachineLocaton
    - Logging of timing: include how long to get semaphore
    - Logging of failure: include how long for each stage
    
    Previously hit a problem when the jclouds location was configured with
    a password + a blank ssh key, and using useJcloudsSshInit=false.
    It failed to ssh to the newly provisioned AWS VM in waitForSshable. It
    got the node.getCredentials, which gives us the ssh-key from the AWS
    key-pair. But then we instantiate an SshMachineLocation to check if we
    can connection (before continuing with the user-setup). That
    machineLocation inherits the password (which has not been set on the
    machine), so it fails to ssh - the password takes precedence over the
    ssh-key.

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to