Commit 9caa53a6 authored by Leo Pound Singer's avatar Leo Pound Singer

Delay reading netrc file

parent 3ec41b47
Pipeline #120534 failed with stages
in 58 seconds
......@@ -51,19 +51,22 @@ def _get_default_login(netrcfile, server):
def _get_login(username, password, netrcfile, interactive, server):
default_username, default_password = _get_default_login(netrcfile, 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:
default_username, default_password = _get_default_login(netrcfile, server)
if username is None and default_username is None:
raise RuntimeError('Username not specified')
elif username is None or username == default_username:
if username is None or username == default_username:
return default_username, default_password
elif interactive:
prompt = 'password for {}@{}: '.format(username, server)
if interactive:
return username, getpass.getpass(prompt)
else:
raise RuntimeError('Password not specified')
raise RuntimeError('Password not specified')
class LVAlertClient(slixmpp.ClientXMPP):
......
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