Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Test SSH establishing a real SSH connection #665

Closed
wants to merge 1 commit into from

Conversation

ggiamarchi
Copy link
Contributor

It's done in the OpenStack driver here but i think it should be generalize because this issue can potentially affect any machine.

Fix #656

Fix docker#656

Signed-off-by: Guillaume Giamarchi <guillaume.giamarchi@gmail.com>
@@ -736,7 +736,37 @@ func (d *Driver) waitForSSHServer() error {
"MachineId": d.MachineId,
"IP": ip,
}).Debug("Waiting for the SSH server to be started...")
return ssh.WaitForTCP(fmt.Sprintf("%s:%d", ip, d.SSHPort))

err = ssh.WaitForTCP(fmt.Sprintf("%s:%d", ip, d.SSHPort))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we update ssh.WaitForTCP to accepts a retries itself?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or how about a new ssh.WaitForSSH function that would loop until "exit 0" could be successfully executed like @ggiamarchi implemented for the OpenStack driver? Other users of ssh.WaitForTCP could be changed to this as needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the @ctrlrsf 's solution too. @ehazlett do you wish i replace calls of WaitForTCP by the new WaitForSSH in all drivers in this PR ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggiamarchi how about you just create the new retry wait. then, as @ctrlrsf said, we can update the others as needed. thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to @ctrlrsf suggestion. @ggiamarchi can you please update to create the generic function in ssh package and use it in the openstack driver in this PR please? We will move the other drivers over to this new method when it is merged.

@nathanleclaire
Copy link
Contributor

In the current master, there is now a generic (universal to all drivers) way that this is done.

@ehazlett perhaps we can close this issue?

Big thanks to @ggiamarchi for the original idea, by the way.

@ehazlett
Copy link
Contributor

Yep, this should be covered now.

@ggiamarchi thanks for the idea!

@ehazlett ehazlett closed this Mar 24, 2015
@ggiamarchi ggiamarchi deleted the fix-openstack-ssh branch March 25, 2015 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[openstack] SSH password
4 participants