Refactor config logic for bools
If a config paramenter is a boolean, the resulting configuration is the logic and of all those given (including defaults). BEWARE in future config implementations!
This commit is contained in:
parent
12f37b3a55
commit
6fea75022f
|
@ -11,7 +11,7 @@ ldap:
|
||||||
|
|
||||||
encryption: TLSv1.2 # Can either be None or TLSv1.2. Default: None
|
encryption: TLSv1.2 # Can either be None or TLSv1.2. Default: None
|
||||||
ciphers: "HIGH"
|
ciphers: "HIGH"
|
||||||
validate: True # Can either be True or False. Default: False
|
validate: False # Can either be True or False. Default: False
|
||||||
ca_certs: openldap/cert.pem
|
ca_certs: openldap/cert.pem
|
||||||
|
|
||||||
username: uid=phi,ou=Services,dc=unit,dc=macaomilano,dc=org
|
username: uid=phi,ou=Services,dc=unit,dc=macaomilano,dc=org
|
||||||
|
@ -19,7 +19,6 @@ ldap:
|
||||||
|
|
||||||
base_dn: dc=unit,dc=macaomilano,dc=org
|
base_dn: dc=unit,dc=macaomilano,dc=org
|
||||||
attribute_id: uid
|
attribute_id: uid
|
||||||
attribute_mail: mail
|
|
||||||
|
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
|
|
|
@ -125,6 +125,8 @@ def recursive_merge(main_config, aux_config):
|
||||||
if aux is not None:
|
if aux is not None:
|
||||||
_main.extend(aux)
|
_main.extend(aux)
|
||||||
_ret_config[key] = list(set(_main))
|
_ret_config[key] = list(set(_main))
|
||||||
|
elif isinstance(default, bool):
|
||||||
|
_ret_config[key] = default and aux and main
|
||||||
else:
|
else:
|
||||||
if main is not None:
|
if main is not None:
|
||||||
_ret_config[key] = main
|
_ret_config[key] = main
|
||||||
|
|
Loading…
Reference in New Issue
Block a user