diff options
author | Tomas Babej <tbabej@redhat.com> | 2014-09-11 13:09:44 +0200 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2014-09-17 14:41:51 +0200 |
commit | 8476dd231d390295bb74b274d49899ab9337e618 (patch) | |
tree | af87db6020d09edbe106da1518fdfb2b2d33a0fb /ipalib/plugins/idviews.py | |
parent | f544f21e9b411b331eaa6a4c63fa9aa1f82af613 (diff) | |
download | freeipa-8476dd231d390295bb74b274d49899ab9337e618.tar.gz freeipa-8476dd231d390295bb74b274d49899ab9337e618.tar.xz freeipa-8476dd231d390295bb74b274d49899ab9337e618.zip |
idviews: Raise NotFound errors if object to override could not be found
Diffstat (limited to 'ipalib/plugins/idviews.py')
-rw-r--r-- | ipalib/plugins/idviews.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ipalib/plugins/idviews.py b/ipalib/plugins/idviews.py index 4813e070d..1a0ca4ac2 100644 --- a/ipalib/plugins/idviews.py +++ b/ipalib/plugins/idviews.py @@ -439,6 +439,13 @@ class baseidoverride(LDAPObject): # about the domain return SID_ANCHOR_PREFIX + sid + # No acceptable object was found + raise errors.NotFound( + reason=_("'%(obj_name)s' %(obj_type)s could not be found") % dict( + obj_name=obj, + obj_type=api.Object[self.override_object].object_name + )) + def resolve_anchor_to_object_name(self, anchor): if anchor.startswith(IPA_ANCHOR_PREFIX): @@ -477,6 +484,10 @@ class baseidoverride(LDAPObject): name = domain_validator.get_trusted_domain_object_from_sid(sid) return name + # No acceptable object was found + raise errors.NotFound( + reason=_("Anchor '%(anchor)s' could not be resolved.") + % dict(anchor=anchor)) def get_dn(self, *keys, **options): keys = keys[:-1] + (self.resolve_object_to_anchor(keys[-1]), ) |