Very minor bug, that would probably never happen in production anyway, but why not fix it.

Pavel
From 1492f14a59f0e0a1a818b6b920c77ede3f5e2a36 Mon Sep 17 00:00:00 2001
From: Pavel Zuna <pz...@redhat.com>
Date: Mon, 9 Aug 2010 19:50:15 -0400
Subject: [PATCH 3/4] Fix bug: not found exc. handler was failing for singleton 
objects

---
 ipalib/plugins/baseldap.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index c995a61..abc1180 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -117,9 +117,12 @@ class LDAPObject(Object):
             del entry_attrs[attr]
 
     def handle_not_found(self, *keys):
+        pkey = ''
+        if self.primary_key:
+            pkey = keys[-1]
         raise errors.NotFound(
             reason=self.object_not_found_msg % {
-                'pkey': keys[-1], 'oname': self.object_name,
+                'pkey': pkey, 'oname': self.object_name,
             }
         )
 
-- 
1.7.1.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to