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

[autoscaler] Fix confirmation (y/N) for autoscaler for Python 2 #1450

Merged
merged 4 commits into from
Jan 24, 2018

Conversation

pcmoritz
Copy link
Contributor

What do these changes do?

This is a small fix to make the confirmation question work as expected in Python 2. There is a small inconsistency between Python 2 and Python 3 input (namely in Python 2 the result is evaled), which gives a "no such variable y" error in Python 2.

Without this fix, the user has to type 'y' instead of y to make sure the result of eval is a string.

@pcmoritz pcmoritz requested a review from ericl January 21, 2018 22:44
@pcmoritz pcmoritz changed the title Fix confirmation (y/N) for autoscaler for Python 2 [autoscaler] Fix confirmation (y/N) for autoscaler for Python 2 Jan 21, 2018
@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/3331/
Test PASSed.

@@ -171,7 +171,10 @@ def get_or_create_head_node(config, no_restart):

def confirm(msg):
print("{}. Do you want to continue [y/N]? ".format(msg), end="")
answer = input()
if sys.version_info[0] > 2:
Copy link
Collaborator

Choose a reason for hiding this comment

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

it would be more consistent with the rest of the codebase to do

if sys.version_info >= (3, 0):

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/3332/
Test PASSed.

if sys.version_info >= (3, 0):
answer = input()
else:
answer = raw_input() # noqa: F821
Copy link
Collaborator

Choose a reason for hiding this comment

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

two spaces before comments.. this will probably be another linting error

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/3335/
Test PASSed.

@AmplabJenkins
Copy link

Merged build finished. Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/3336/
Test PASSed.

@ericl ericl merged commit a1b01ee into ray-project:master Jan 24, 2018
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.

4 participants