Skip to content

Commit f048953

Browse files
committed
Extract ldap base dn to variable
1 parent 0befc74 commit f048953

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

comanage_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
PRODUCTION_OSG_CO_ID = 7
1818
PRODUCTION_UNIX_CLUSTER_ID = 1
1919
PRODUCTION_LDAP_TARGET_ID = 6
20+
LDAP_BASE_DN = "o=OSG,o=CO,dc=cilogon,dc=org"
2021

2122
#TEST VALUES
2223

@@ -184,7 +185,7 @@ def __init__(self, ldap_server, ldap_user, ldap_authtok):
184185
self.connection = Connection(self.server, ldap_user, ldap_authtok, client_strategy=SAFE_SYNC, auto_bind=True)
185186

186187
def search(self, ou, filter_str, attrs):
187-
_, _, response, _ = self.connection.search(f"ou={ou},o=OSG,o=CO,dc=cilogon,dc=org", filter_str, attributes=attrs)
188+
_, _, response, _ = self.connection.search(f"ou={ou},{LDAP_BASE_DN}", filter_str, attributes=attrs)
188189
return response
189190

190191
def get_ldap_groups(ldap_server, ldap_user, ldap_authtok):

0 commit comments

Comments
 (0)