Skip to content

Commit f5b239d

Browse files
committed
Save 150ms startup time by only importing ldap when necessary
1 parent 2ecf5fc commit f5b239d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/common/oursrc/accountadm/mbash.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ import os
77
import subprocess
88
import sys
99

10-
import ldap
11-
import ldap.filter
12-
1310
BASE_DN = 'dc=scripts,dc=mit,dc=edu'
1411

1512
def get_pool(username):
@@ -18,6 +15,9 @@ def get_pool(username):
1815
1916
Returns: (default vhost pool IP, [(pool name, vhost name)] if multiple pools)
2017
"""
18+
import ldap
19+
import ldap.filter
20+
2121
ldap_uri = ldap.get_option(ldap.OPT_URI)
2222

2323
ll = ldap.initialize(ldap_uri)

0 commit comments

Comments
 (0)