2020-10-26 14:43:11 +01:00
|
|
|
from .configuration import read_configurations
|
2018-02-22 14:49:38 +01:00
|
|
|
|
2020-10-26 14:43:11 +01:00
|
|
|
_loaded_configurations = read_configurations(
|
|
|
|
config_dir = '/etc/netbox/config/ldap/',
|
|
|
|
config_module = 'netbox.configuration.ldap',
|
|
|
|
main_config = 'ldap_config')
|
2020-10-18 02:34:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
def __getattr__(name):
|
|
|
|
for config in _loaded_configurations:
|
|
|
|
try:
|
|
|
|
return getattr(config, name)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
raise AttributeError
|
2020-10-27 12:27:51 +01:00
|
|
|
|
|
|
|
def __dir__():
|
|
|
|
names = []
|
|
|
|
for config in _loaded_configurations:
|
2020-10-27 14:12:26 +01:00
|
|
|
names.extend(config.__dir__())
|
2020-10-27 12:27:51 +01:00
|
|
|
return names
|