projects
/
mirror
/
userdir-ldap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
GenSSHShadow
[mirror/userdir-ldap.git]
/
UDLdap.py
diff --git
a/UDLdap.py
b/UDLdap.py
index
9e2d2ee
..
f11c8b3
100644
(file)
--- a/
UDLdap.py
+++ b/
UDLdap.py
@@
-3,8
+3,8
@@
import time
import userdir_ldap
class Account:
import userdir_ldap
class Account:
- array_values = ['keyFingerPrint']
- int_values = ['shadowExpire']
+ array_values = ['keyFingerPrint'
, 'mailWhitelist', 'mailRBL', 'mailRHSBL', 'supplementaryGid', 'sshRSAAuthKey'
]
+ int_values = ['shadowExpire'
, 'gidNumber'
]
defaults = {
'accountStatus': 'active',
'keyFingerPrint': []
defaults = {
'accountStatus': 'active',
'keyFingerPrint': []
@@
-30,11
+30,12
@@
class Account:
if key in self.attributes:
if key in self.array_values:
return self.attributes[key]
if key in self.attributes:
if key in self.array_values:
return self.attributes[key]
- elif key in self.int_values:
- if len(self.attributes[key]) == 1:
- return int(self.attributes[key][0])
- else:
- raise ValueError, 'non-array value has not exactly one value'
+
+ if not len(self.attributes[key]) == 1:
+ raise ValueError, 'non-array value has not exactly one value'
+
+ if key in self.int_values:
+ return int(self.attributes[key][0])
else:
return self.attributes[key][0]
elif key in self.defaults:
else:
return self.attributes[key][0]
elif key in self.defaults: