Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poll remote servers until live. #33

Merged
merged 1 commit into from
Sep 22, 2017
Merged

Poll remote servers until live. #33

merged 1 commit into from
Sep 22, 2017

Conversation

kdelee
Copy link
Contributor

@kdelee kdelee commented Sep 20, 2017

It takes time between the power on signal is sent to the remote servers
and they are available over ssh for rho. These changes make it so
servers are polled until they respond or a timeout limit is reached.

Closes #28

@kdelee kdelee requested a review from elyezer September 20, 2017 15:33
@coveralls
Copy link

coveralls commented Sep 20, 2017

Coverage Status

Coverage remained the same at 77.907% when pulling 939ed39 on issues/28 into be75912 on master.

Copy link
Contributor

@elyezer elyezer left a comment

Choose a reason for hiding this comment

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

Just a small nitpick, other than that this looks good.

ping. Keep trying until a connection is made for all servers or the timeout
limit is reached.
"""
from camayoc import cli
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move this import to the top of the file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually you can add a new item to line 5:

from camayoc import cli, config

Copy link
Contributor

@elyezer elyezer left a comment

Choose a reason for hiding this comment

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

Ops I missed these points on the previous review, can you please update?

unreached = [host for host in unreached if not is_live(client, host)]
sleep(10)
timeout -= 10
return
Copy link
Contributor

Choose a reason for hiding this comment

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

This return is not needed

client = cli.Client(system)

unreached = servers
while unreached and timeout > 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

What should happen when the timeout is over and still some unreached hosts?

It takes time between the power on signal is sent to the remote servers
and they are available over ssh for rho. These changes make it so
servers are polled until they respond or a timeout limit is reached.

Closes #28
@coveralls
Copy link

coveralls commented Sep 20, 2017

Coverage Status

Coverage remained the same at 77.907% when pulling ba04ad8 on issues/28 into 632bffd on master.

Copy link
Contributor

@elyezer elyezer left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

Keep trying until a connection is made for all servers or the timeout
limit is reached.

If the timeout limit is reached, we exit even if there are unreached hosts.
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@kdelee
Copy link
Contributor Author

kdelee commented Sep 20, 2017

@elyezer thanks for the feedback!

@coveralls
Copy link

coveralls commented Sep 20, 2017

Coverage Status

Coverage remained the same at 77.907% when pulling 9bf40fb on issues/28 into 632bffd on master.

@kdelee kdelee merged commit 3aad992 into master Sep 22, 2017
@kdelee kdelee deleted the issues/28 branch September 22, 2017 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants