get_attr : make case-insensitive on attribute name
This commit is contained in:
parent
bf420f0a81
commit
0f69b2a713
1 changed files with 5 additions and 0 deletions
|
@ -106,6 +106,11 @@ class LdapServer(object):
|
||||||
return obj[0][0]
|
return obj[0][0]
|
||||||
|
|
||||||
def get_attr(self,obj,attr,all=None,default=None):
|
def get_attr(self,obj,attr,all=None,default=None):
|
||||||
|
if attr not in obj:
|
||||||
|
for k in obj:
|
||||||
|
if k.lower() == attr.lower():
|
||||||
|
attr = k
|
||||||
|
break
|
||||||
if all is not None:
|
if all is not None:
|
||||||
if attr in obj:
|
if attr in obj:
|
||||||
return obj[attr]
|
return obj[attr]
|
||||||
|
|
Loading…
Reference in a new issue