summaryrefslogtreecommitdiffstats
path: root/ipalib/base.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-08-04 02:41:11 -0600
committerRob Crittenden <rcritten@redhat.com>2009-08-05 12:18:51 -0400
commitc0f558d98b46df6131b221b746e8dc54787225e7 (patch)
treec4e39d94ed0a913cf618f5d6764f848e890a2fc2 /ipalib/base.py
parentb7b9f9b6a66f75e838a3a60b105ac7d0f8197ed2 (diff)
downloadfreeipa-c0f558d98b46df6131b221b746e8dc54787225e7.zip
freeipa-c0f558d98b46df6131b221b746e8dc54787225e7.tar.gz
freeipa-c0f558d98b46df6131b221b746e8dc54787225e7.tar.xz
Removed PluginProxy and all its uses
Diffstat (limited to 'ipalib/base.py')
-rw-r--r--ipalib/base.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipalib/base.py b/ipalib/base.py
index e0951e4..38b1e8f 100644
--- a/ipalib/base.py
+++ b/ipalib/base.py
@@ -382,7 +382,7 @@ class NameSpace(ReadOnly):
examples, see the `plugable.API` and the `frontend.Command` classes.
"""
- def __init__(self, members, sort=True):
+ def __init__(self, members, sort=True, name_attr='name'):
"""
:param members: An iterable providing the members.
:param sort: Whether to sort the members by member name.
@@ -394,14 +394,14 @@ class NameSpace(ReadOnly):
self.__sort = sort
if sort:
self.__members = tuple(
- sorted(members, key=lambda m: m.name)
+ sorted(members, key=lambda m: getattr(m, name_attr))
)
else:
self.__members = tuple(members)
- self.__names = tuple(m.name for m in self.__members)
+ self.__names = tuple(getattr(m, name_attr) for m in self.__members)
self.__map = dict()
for member in self.__members:
- name = check_name(member.name)
+ name = check_name(getattr(member, name_attr))
if name in self.__map:
raise AttributeError(OVERRIDE_ERROR %
(self.__class__.__name__, name, self.__map[name], member)