-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Centralized interactive input() function that checks if STDIN is a TTY #1856
Conversation
Can we have a wrapper on getpass that confirms the typed password? I'd rather do that than roll my own in VM/VMSS create. |
User should always type the password twice? |
@@ -19,7 +19,7 @@ | |||
import azure.cli.core.telemetry as telemetry | |||
from azure.cli.core._util import CLIError | |||
from azure.cli.core.application import APPLICATION | |||
from azure.cli.core._prompting import prompt_y_n, NoTTYException | |||
from azure.cli.core.prompting import prompt_y_n, NoTTYException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -6,15 +6,15 @@ | |||
from __future__ import print_function | |||
import os | |||
import sys | |||
from six.moves import input, configparser #pylint: disable=redefined-builtin | |||
from six.moves import configparser #pylint: disable=redefined-builtin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8: two spaces between the '#' and the previous char, one space between the '#' and the following char.
I would argue that yes, the user should always enter the password twice, but you could parameterize it with a default of False. The idea is that 1) the portal and like 99% of regular applications do this and 2) it would be very annoying to mistype your password and find you have no ability to access the VM you just waited to create because of a password typo. This at least ensures you got your password right or made the same mistake twice (in which case, no one can help you!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Password prompt (even if opt-in) pleeease :)
- Promote _prompting to prompting - Use prompt() to check TTY before getting user input + fix pep8 spacing
cc5929d
to
079f695
Compare
@tjprescott Added |
Thanks @derekbekoe ! |
Closes #1349