3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 13:09:23 +01:00

pylink: Warn users that configuration is changing. (closes #361)

This commit is contained in:
Ken Spencer 2016-11-23 00:06:54 -05:00 committed by James Lu
parent a57f194123
commit a173e2a61f

View File

@ -52,6 +52,10 @@ def validateConf(conf):
assert conf.get(section), "Missing %r section in config." % section
# Make sure at least one form of authentication is valid.
# Also we'll warn them that login:user/login:password is deprecated
if conf['login'].get('password') or conf['login'].get('user'):
log.warning("The 'login:user' and 'login:password' options are deprecated since PyLink 1.1. Please switch to the new 'login:accounts' format as outlined in the example config.")
old_login_valid = type(conf['login'].get('password')) == type(conf['login'].get('user')) == str
newlogins = conf['login'].get('accounts', {})
new_login_valid = len(newlogins) >= 1