From a3c21ae0ac35f0305d2d1cd539c3ecd021c3857a Mon Sep 17 00:00:00 2001 From: comphilip Date: Tue, 27 Oct 2020 19:27:51 +0800 Subject: [PATCH 1/2] Fix ldap configuration in /etc/netbox/config/ldap/*.py not loaded --- docker/ldap_config.docker.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker/ldap_config.docker.py b/docker/ldap_config.docker.py index bcaf7e7..fd82f3a 100644 --- a/docker/ldap_config.docker.py +++ b/docker/ldap_config.docker.py @@ -13,3 +13,10 @@ def __getattr__(name): except: pass raise AttributeError + +def __dir__(): + names = [] + for config in _loaded_configurations: + for name in config.__dir__(): + names.append(name) + return names From 7694fd320ae3558cbcf417d6f2d4166033bf4a23 Mon Sep 17 00:00:00 2001 From: comphilip Date: Tue, 27 Oct 2020 21:12:26 +0800 Subject: [PATCH 2/2] use extend method for simplification. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christian Mäder --- docker/ldap_config.docker.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/ldap_config.docker.py b/docker/ldap_config.docker.py index fd82f3a..169007f 100644 --- a/docker/ldap_config.docker.py +++ b/docker/ldap_config.docker.py @@ -17,6 +17,5 @@ def __getattr__(name): def __dir__(): names = [] for config in _loaded_configurations: - for name in config.__dir__(): - names.append(name) + names.extend(config.__dir__()) return names