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(
|
2021-02-08 11:59:33 +01:00
|
|
|
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):
|
2021-02-08 11:59:33 +01:00
|
|
|
for config in _loaded_configurations:
|
|
|
|
try:
|
|
|
|
return getattr(config, name)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
raise AttributeError
|
|
|
|
|
2020-10-27 12:27:51 +01:00
|
|
|
|
|
|
|
def __dir__():
|
2021-02-08 11:59:33 +01:00
|
|
|
names = []
|
|
|
|
for config in _loaded_configurations:
|
|
|
|
names.extend(config.__dir__())
|
|
|
|
return names
|