Only check pw file if defined

This commit is contained in:
Matthew Planchard 2018-07-26 21:17:32 -05:00
parent af4037fff5
commit 0742577a4d
1 changed files with 9 additions and 7 deletions

View File

@ -69,13 +69,15 @@ def _run_app_from_config(config):
elif getattr(config, 'update_packages', False):
return _update(config)
if (not config.authenticate and config.password_file != '.' or
config.authenticate and config.password_file == '.'):
auth_err = (
"When auth-ops-list is empty (-a=.), password-file (-P=%r) "
"must also be empty ('.')!"
)
sys.exit(auth_err % config.password_file)
# TODO: move this to the auth plugin.
if hasattr(config, 'password_file'):
if (not config.authenticate and config.password_file != '.' or
config.authenticate and config.password_file == '.'):
auth_err = (
"When auth-ops-list is empty (-a=.), password-file (-P=%r) "
"must also be empty ('.')!"
)
sys.exit(auth_err % config.password_file)
if config.server and config.server.startswith('gevent'):
import gevent.monkey # @UnresolvedImport