Make get_dn parameter list more generic. Fix Attribute name regex.

The old name regex made it impossible to have Attribute instances with
names composed of more than two words separated by underscores.
This commit is contained in:
Pavel Zuna
2009-06-10 14:18:08 +02:00
committed by Rob Crittenden
parent 4b08770b78
commit dc23be6878

View File

@@ -795,9 +795,9 @@ class Object(HasParam):
continue
yield param
def get_dn(self, primary_key):
def get_dn(self, *args, **kwargs):
"""
Construct an LDAP DN from a primary_key.
Construct an LDAP DN.
"""
raise NotImplementedError('%s.get_dn()' % self.name)
@@ -878,7 +878,7 @@ class Attribute(Plugin):
def __init__(self):
m = re.match(
'^([a-z][a-z0-9]+)_([a-z][a-z0-9]+)$',
'^([a-z][a-z0-9]+)_([a-z][a-z0-9]+(?:_[a-z][a-z0-9]+)*)$',
self.__class__.__name__
)
assert m