summaryrefslogtreecommitdiffstats
path: root/ipalib/crud.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-10-02 09:29:22 -0400
committerJason Gerard DeRose <jderose@redhat.com>2009-10-05 13:28:24 -0600
commit97dfa586dea42d44ad8e1d9148547fd805abd046 (patch)
tree6df4db964006dd53449c7eb85aa0ea55d6e94e6e /ipalib/crud.py
parent48785a5af1a2dbabd6da4cfaee000d3100260f4d (diff)
downloadfreeipa-97dfa586dea42d44ad8e1d9148547fd805abd046.tar.gz
freeipa-97dfa586dea42d44ad8e1d9148547fd805abd046.tar.xz
freeipa-97dfa586dea42d44ad8e1d9148547fd805abd046.zip
Make primary_key optional.
The pwpolicy plugin doesn't have a primary key but can still take advantage of other parts of the framework.
Diffstat (limited to 'ipalib/crud.py')
-rw-r--r--ipalib/crud.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ipalib/crud.py b/ipalib/crud.py
index 57a2c782f..6d1a87f32 100644
--- a/ipalib/crud.py
+++ b/ipalib/crud.py
@@ -29,7 +29,8 @@ class Create(frontend.Method):
"""
def get_args(self):
- yield self.obj.primary_key.clone(attribute=True)
+ if self.obj.primary_key:
+ yield self.obj.primary_key.clone(attribute=True)
def get_options(self):
if self.extra_options_first:
@@ -48,7 +49,8 @@ class PKQuery(frontend.Method):
"""
def get_args(self):
- yield self.obj.primary_key.clone(attribute=True, query=True)
+ if self.obj.primary_key:
+ yield self.obj.primary_key.clone(attribute=True, query=True)