mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
use default authenticator if none is defined
This commit is contained in:
parent
6f7f870d3d
commit
ac4a4c34b1
1 changed files with 32 additions and 33 deletions
|
@ -256,22 +256,21 @@ class BaseActionsMapParser(object):
|
||||||
raise MoulinetteError("error_see_log")
|
raise MoulinetteError("error_see_log")
|
||||||
|
|
||||||
# -- 'authenticator'
|
# -- 'authenticator'
|
||||||
try:
|
if "authenticator" in configuration:
|
||||||
auth = configuration["authenticator"]
|
auth = configuration["authenticator"]
|
||||||
except KeyError:
|
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
|
auth = 'default'
|
||||||
if not is_global and isinstance(auth, str):
|
if not is_global and isinstance(auth, str):
|
||||||
try:
|
|
||||||
# Store needed authenticator profile
|
# Store needed authenticator profile
|
||||||
conf["authenticator"] = self.global_conf["authenticator"][auth]
|
if auth not in self.global_conf["authenticator"]:
|
||||||
except KeyError:
|
|
||||||
logger.error(
|
logger.error(
|
||||||
"requesting profile '%s' which is undefined in "
|
"requesting profile '%s' which is undefined in "
|
||||||
"global configuration of 'authenticator'",
|
"global configuration of 'authenticator'",
|
||||||
auth,
|
auth,
|
||||||
)
|
)
|
||||||
raise MoulinetteError("error_see_log")
|
raise MoulinetteError("error_see_log")
|
||||||
|
else:
|
||||||
|
conf["authenticator"] = auth
|
||||||
elif is_global and isinstance(auth, dict):
|
elif is_global and isinstance(auth, dict):
|
||||||
if len(auth) == 0:
|
if len(auth) == 0:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
|
|
Loading…
Add table
Reference in a new issue