Inconsistent error message for duplicate user

When duplicate user is added an inconsistent error message to the rest
of the framework is printed. This patch changes this to standard
duplicate error message.

https://fedorahosted.org/freeipa/ticket/1116
This commit is contained in:
Martin Kosek
2011-03-28 16:27:42 +02:00
committed by Rob Crittenden
parent b29bd47273
commit e7fda0652d

View File

@@ -261,7 +261,7 @@ class user_add(LDAPCreate):
self.api.Command['group_show'](keys[-1])
try:
self.api.Command['user_show'](keys[-1])
raise errors.DuplicateEntry()
self.obj.handle_duplicate_entry(*keys)
except errors.NotFound:
raise errors.ManagedGroupExistsError(group=keys[-1])
except errors.NotFound: