11import getpass
22import json
3- import os
4- import sys
53
64import requests
75from six .moves import input
86
97from .config import *
108from .method import requests_exception_to_error_obj , response_error_check , status_code_to_error_obj
119
12-
13- UNAUTHORIZED_EXTENDED_INFO = ' \n \n Note: Please keep in mind that currently you can login only with the email and password ' \
14- 'from your Paperspace account. If you \' re using AD, SAML or GitHub credentials, please log into the Paperspace Console ' \
15- 'and create an API key for use with the CLI client. For more information, please refer to the CLI client documentation.'
10+ UNAUTHORIZED_EXTENDED_INFO = ' \n \n Note: Please keep in mind that currently you can login only with the email and ' \
11+ ' password from your Paperspace account. If you \' re using AD, SAML or GitHub ' \
12+ ' credentials, please log into the Paperspace Console and create an API key for use with ' \
13+ ' the CLI client. For more information, please refer to the CLI client documentation.'
1614
1715
1816def is_error_or_missing_keys_print (res , * required_keys ):
@@ -50,7 +48,7 @@ def login(email=None, password=None, apiToken=None):
5048 password = getpass .getpass ('Password: ' )
5149
5250 # get access_token
53- params = { "email" : email , "password" : password }
51+ params = {"email" : email , "password" : password }
5452 try :
5553 r = requests .request ('post' , config .CONFIG_HOST + '/users/login' ,
5654 json = params )
@@ -66,7 +64,7 @@ def login(email=None, password=None, apiToken=None):
6664 return False
6765
6866 # get api key using access_token
69- params = { 'access_token' : res ['id' ] }
67+ params = {'access_token' : res ['id' ]}
7068 if apiToken :
7169 params ['apiToken' ] = apiToken
7270 try :
0 commit comments