Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 27, 2023
1 parent 8b9e0a8 commit 21c63e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions dpdispatcher/dp_cloud_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,26 @@ def __init__(self, context):
self.grouped = self.input_data.get("grouped", False)
email = context.remote_profile.get("email", None)
phone = context.remote_profile.get("phone", None)
username = context.remote_profile.get('username', None)
password = context.remote_profile.get('password', None)
username = context.remote_profile.get("username", None)
password = context.remote_profile.get("password", None)
if email is None and username is not None:
raise DeprecationWarning("username is no longer support in current version, "
"please consider use email instead of username.")
raise DeprecationWarning(
"username is no longer support in current version, "
"please consider use email instead of username."
)
if email is None and phone is None:
raise ValueError("can not find email/phone number in remote_profile, please check your machine file.")
raise ValueError(
"can not find email/phone number in remote_profile, please check your machine file."
)

if password is None:
raise ValueError(
"can not find password in remote_profile, please check your machine file."
)
if self.api_version == 1:
raise DeprecationWarning('api version 1 is deprecated. Use version 2 instead.')
raise DeprecationWarning(
"api version 1 is deprecated. Use version 2 instead."
)

account = email
if email is None:
Expand Down
2 changes: 1 addition & 1 deletion dpdispatcher/dp_cloud_server_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
self.remote_profile = remote_profile
email = remote_profile.get("email", None)
phone = remote_profile.get("phone", None)
password = remote_profile.get('password')
password = remote_profile.get("password")
if email is None and phone is None:
raise ValueError(
"can not find email/phone number in remote_profile, please check your machine file."
Expand Down

0 comments on commit 21c63e9

Please sign in to comment.