Skip to content

Commit

Permalink
Address the comment of @martindurant
Browse files Browse the repository at this point in the history
In case the user is not None and no password has been provided, we will
default back to the original behavior
  • Loading branch information
gdiepen committed Nov 1, 2023
1 parent 90683e1 commit 779e520
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fsspec/implementations/webhdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,18 @@ def __init__(
)
self.pars["delegation"] = token
self.user = user

if password is not None:
if self.user is None:
raise ValueError(
"If passing a password, the user must also be"
"set in order to set up the basic-auth"
)
self.password = password
else:
if user is not None:
self.pars["user.name"] = user

if proxy_to is not None:
self.pars["doas"] = proxy_to
if kerberos and user is not None:
Expand Down

0 comments on commit 779e520

Please sign in to comment.