@@ -28,17 +28,19 @@ def __init__(self, context):
28
28
self .api_version = self .input_data .get ("lebesgue_version" , 2 )
29
29
self .grouped = self .input_data .get ("grouped" , False )
30
30
email = context .remote_profile .get ("email" , None )
31
+ phone = context .remote_profile .get ("phone" , None )
31
32
username = context .remote_profile .get ("username" , None )
32
33
password = context .remote_profile .get ("password" , None )
33
34
if email is None and username is not None :
34
35
raise DeprecationWarning (
35
36
"username is no longer support in current version, "
36
37
"please consider use email instead of username."
37
38
)
38
- if email is None :
39
+ if email is None and phone is None :
39
40
raise ValueError (
40
- "can not find email in remote_profile, please check your machine file."
41
+ "can not find email/phone number in remote_profile, please check your machine file."
41
42
)
43
+
42
44
if password is None :
43
45
raise ValueError (
44
46
"can not find password in remote_profile, please check your machine file."
@@ -47,7 +49,12 @@ def __init__(self, context):
47
49
raise DeprecationWarning (
48
50
"api version 1 is deprecated. Use version 2 instead."
49
51
)
50
- self .api = Client (email , password )
52
+
53
+ account = email
54
+ if email is None :
55
+ account = phone
56
+ self .api = Client (account , password )
57
+
51
58
self .group_id = None
52
59
53
60
def gen_script (self , job ):
0 commit comments