def get_tty_password(confirm):
    """When returning a password from a TTY we assume a user
    is entering it on a keyboard so we ask for confirmation."""
    LOG.debug("Reading password from TTY")
    new_password = getpass('Enter Password: ', stream=sys.stderr)
    if not new_password:
        raise aomi.exceptions.AomiCommand("Must specify a password")

    if not confirm:
        return new_password

    confirm_password = getpass('Again, Please: ', stream=sys.stderr)
    if confirm_password != new_password:
        raise aomi.exceptions.AomiCommand("Passwords do not match")

    return new_password
def get_tty_password ( confirm ) : LOG . debug ( "Reading password from TTY" ) new_password = getpass ( 'Enter Password: ' , stream = sys . stderr ) if not new_password : raise aomi . exceptions . AomiCommand ( "Must specify a password" ) if not confirm : return new_password confirm_password = getpass ( 'Again, Please: ' , stream = sys . stderr ) if confirm_password != new_password : raise aomi . exceptions . AomiCommand ( "Passwords do not match" ) return new_password
When returning a password from a TTY we assume a user
    is entering it on a keyboard so we ask for confirmation.