summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2015-04-29 08:16:04 +0200
committerTomas Babej <tbabej@redhat.com>2015-07-02 13:23:21 +0200
commitbff7a748d622a174a6023b32b5b13ed8b53975dc (patch)
tree90baae5c235f47a754de56d4eda91f444c3b2d61
parent0e11a87090f46695024a67eed58dbb5aaa7be9a3 (diff)
downloadfreeipa-bff7a748d622a174a6023b32b5b13ed8b53975dc.zip
freeipa-bff7a748d622a174a6023b32b5b13ed8b53975dc.tar.gz
freeipa-bff7a748d622a174a6023b32b5b13ed8b53975dc.tar.xz
idviews: Do not abort the find & show commands on conversion errors
https://fedorahosted.org/freeipa/ticket/4524 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
-rw-r--r--ipalib/plugins/idviews.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/ipalib/plugins/idviews.py b/ipalib/plugins/idviews.py
index 9f58c83..3bd5ad6 100644
--- a/ipalib/plugins/idviews.py
+++ b/ipalib/plugins/idviews.py
@@ -686,7 +686,12 @@ class baseidoverride_find(LDAPSearch):
def post_callback(self, ldap, entries, truncated, *args, **options):
for entry in entries:
- self.obj.convert_anchor_to_human_readable_form(entry, **options)
+ try:
+ self.obj.convert_anchor_to_human_readable_form(entry, **options)
+ except errors.NotFound:
+ # If the conversion to readle form went wrong, do not
+ # abort the whole find command. Use non-converted entry.
+ pass
return truncated
@@ -694,7 +699,12 @@ class baseidoverride_show(LDAPRetrieve):
__doc__ = _('Display information about an ID override.')
def post_callback(self, ldap, dn, entry_attrs, *keys, **options):
- self.obj.convert_anchor_to_human_readable_form(entry_attrs, **options)
+ try:
+ self.obj.convert_anchor_to_human_readable_form(entry_attrs, **options)
+ except errors.NotFound:
+ # If the conversion to readle form went wrong, do not
+ # abort the whole show command. Use non-converted entry.
+ pass
return dn