summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-10-02 15:16:38 +0200
committerPetr Viktorin <pviktori@redhat.com>2013-10-02 16:09:07 +0200
commit295ce7bf18510efbe7d170887eb4e6956d3db035 (patch)
treeb1a2761d11f24aadde26ec605397e72124527b9b /ipalib/plugins/baseldap.py
parent1acd00487fad66983ec2716cb4ef888f8813d390 (diff)
downloadfreeipa-295ce7bf18510efbe7d170887eb4e6956d3db035.tar.gz
freeipa-295ce7bf18510efbe7d170887eb4e6956d3db035.tar.xz
freeipa-295ce7bf18510efbe7d170887eb4e6956d3db035.zip
Use correct super-calls in get_args() methods
The get_args methods in ipalib.crud and ipalib.plugins.baseldap used super() calls that skipped some of the classes in the inheritance chain, and contained code that reimplemented some of the skipped functionality. This made it difficult to customize the get_args behavior. Use proper super() calls.
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py30
1 files changed, 8 insertions, 22 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 4a7950270..6d734d025 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -991,12 +991,9 @@ class LDAPCreate(BaseLDAPCommand, crud.Create):
takes_options = (BaseLDAPCommand.setattr_option, BaseLDAPCommand.addattr_option)
def get_args(self):
- #pylint: disable=E1003
for key in self.obj.get_ancestor_primary_keys():
yield key
- if self.obj.primary_key:
- yield self.obj.primary_key.clone(attribute=True)
- for arg in super(crud.Create, self).get_args():
+ for arg in super(LDAPCreate, self).get_args():
yield arg
has_output_params = global_output_params
@@ -1135,12 +1132,9 @@ class LDAPQuery(BaseLDAPCommand, crud.PKQuery):
Base class for commands that need to retrieve an existing entry.
"""
def get_args(self):
- #pylint: disable=E1003
for key in self.obj.get_ancestor_primary_keys():
yield key
- if self.obj.primary_key:
- yield self.obj.primary_key.clone(attribute=True, query=True)
- for arg in super(crud.PKQuery, self).get_args():
+ for arg in super(LDAPQuery, self).get_args():
yield arg
# list of attributes we want exported to JSON
@@ -1167,15 +1161,11 @@ class LDAPMultiQuery(LDAPQuery):
)
def get_args(self):
- #pylint: disable=E1003
- for key in self.obj.get_ancestor_primary_keys():
- yield key
- if self.obj.primary_key:
- yield self.obj.primary_key.clone(
- attribute=True, query=True, multivalue=True
- )
- for arg in super(crud.PKQuery, self).get_args():
- yield arg
+ for arg in super(LDAPMultiQuery, self).get_args():
+ if self.obj.primary_key and arg.name == self.obj.primary_key.name:
+ yield arg.clone(multivalue=True)
+ else:
+ yield arg
class LDAPRetrieve(LDAPQuery):
@@ -1758,13 +1748,9 @@ class LDAPSearch(BaseLDAPCommand, crud.Search):
)
def get_args(self):
- #pylint: disable=E1003
for key in self.obj.get_ancestor_primary_keys():
yield key
- yield Str('criteria?',
- noextrawhitespace=False,
- doc=_('A string searched in all relevant object attributes'))
- for arg in super(crud.Search, self).get_args():
+ for arg in super(LDAPSearch, self).get_args():
yield arg
def get_member_options(self, attr):