diff options
author | Petr Viktorin <pviktori@redhat.com> | 2012-03-27 09:27:11 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2012-04-10 21:05:45 -0400 |
commit | 6d0e4e58fcc33f8c4514750eb6e5d7b5882efef8 (patch) | |
tree | d576654b11cb834c01701e855bbf324aa1ce2171 /ipalib/plugins/netgroup.py | |
parent | 689bea65757bae66b387acde3ffc7897e6b0ec3b (diff) | |
download | freeipa-6d0e4e58fcc33f8c4514750eb6e5d7b5882efef8.tar.gz freeipa-6d0e4e58fcc33f8c4514750eb6e5d7b5882efef8.tar.xz freeipa-6d0e4e58fcc33f8c4514750eb6e5d7b5882efef8.zip |
Fix expected error messages in tests
Have the test suite check error messages.
Since XMLRPC doesn't give us structured error information, just
compare the resulting text.
Fix messages that tests expect to cause.
Minor changes:
Make netgroup-mod's NotFound message consistent with other objects
and methods.
In test_automember_plugin, test with nonexistent automember rules
of both types, instead of nonexistent users.
https://fedorahosted.org/freeipa/ticket/2549
Diffstat (limited to 'ipalib/plugins/netgroup.py')
-rw-r--r-- | ipalib/plugins/netgroup.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ipalib/plugins/netgroup.py b/ipalib/plugins/netgroup.py index 06372a592..693c00c1a 100644 --- a/ipalib/plugins/netgroup.py +++ b/ipalib/plugins/netgroup.py @@ -202,7 +202,10 @@ class netgroup_mod(LDAPUpdate): msg_summary = _('Modified netgroup "%(value)s"') def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options): - (dn, entry_attrs) = ldap.get_entry(dn, attrs_list) + try: + (dn, entry_attrs) = ldap.get_entry(dn, attrs_list) + except errors.NotFound: + self.obj.handle_not_found(*keys) if is_all(options, 'usercategory') and 'memberuser' in entry_attrs: raise errors.MutuallyExclusiveError(reason="user category cannot be set to 'all' while there are allowed users") if is_all(options, 'hostcategory') and 'memberhost' in entry_attrs: |