Don't try to process .netrc file if username and password are both provided to LVAlertClient

parent c501b07c
Pipeline #50585 passed with stages
in 3 minutes and 47 seconds
......@@ -67,12 +67,14 @@ def _get_default_login(netrcfile, server):
def _get_login(username, password, netrc, interactive, server):
# Return right away if username and password are both provided
if username is not None and password is not None:
return username, password
default_username, default_password = _get_default_login(netrc, server)
prompt = 'password for {}@{}: '.format(username, server)
if username is not None and password is not None:
return username, password
elif username is None and default_username is None:
if username is None and default_username is None:
raise RuntimeError('Username not specified')
elif username is None or username == default_username:
return default_username, default_password
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment