Hi,

on receiving a PublicError we fail with InternalError since msg is not
defined.

-- 
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org 


>From d81984981a2de72aa820feb710f1111ec1ccb8e5 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Thu, 24 Jul 2014 12:33:35 +0200
Subject: [PATCH] baseldap: Fix undefined variable reference in
 LDAPAddReverseMember and LDAPRemoveReverseMember

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

diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 610b9b0f11660996a874fe6151e202f8241c5f27..f96665f82e5562b274e57043c01e8243692f1236 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -2108,6 +2108,8 @@ class LDAPAddReverseMember(LDAPModReverseMember):
                     failed['member'][self.reverse_attr].append((attr, unicode(msg.strip())))
 
             except errors.PublicError, e:
+                msg = str(e)
+                (attr, msg) = msg.split(':', 1)
                 failed['member'][self.reverse_attr].append((attr, unicode(msg)))
 
         # Update the member data.
@@ -2209,6 +2211,8 @@ class LDAPRemoveReverseMember(LDAPModReverseMember):
                     failed['member'][self.reverse_attr].append((attr, unicode(msg.strip())))
 
             except errors.PublicError, e:
+                msg = str(e)
+                (attr, msg) = msg.split(':', 1)
                 failed['member'][self.reverse_attr].append((attr, unicode(msg)))
 
         # Update the member data.
-- 
1.9.3

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

Reply via email to