2020-10-26 08:43:11 -05:00
|
|
|
from .configuration import read_configurations
|
2018-02-22 07:49:38 -06:00
|
|
|
|
2020-10-26 08:43:11 -05:00
|
|
|
_loaded_configurations = read_configurations(
|
2021-02-08 04:59:33 -06:00
|
|
|
config_dir="/etc/netbox/config/ldap/",
|
|
|
|
config_module="netbox.configuration.ldap",
|
|
|
|
main_config="ldap_config",
|
|
|
|
)
|
2020-10-17 19:34:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
def __getattr__(name):
|
2021-02-08 04:59:33 -06:00
|
|
|
for config in _loaded_configurations:
|
|
|
|
try:
|
|
|
|
return getattr(config, name)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
raise AttributeError
|
|
|
|
|
2020-10-27 06:27:51 -05:00
|
|
|
|
|
|
|
def __dir__():
|
2021-02-08 04:59:33 -06:00
|
|
|
names = []
|
|
|
|
for config in _loaded_configurations:
|
|
|
|
names.extend(config.__dir__())
|
|
|
|
return names
|