Check if the group exists
When setting default group, we should check if the group exists. If not, it could lead to some issues with adding new users after the new default group is set. https://fedorahosted.org/freeipa/ticket/504
This commit is contained in:
1 parent
9a5d4f2e18
commit
19049d1a64
1 file changed
+6
@@ -149,6 +149,12 @@ class config_mod(LDAPUpdate):
|
||||
entry_attrs['ipamigrationenabled'] = 'TRUE'
|
||||
else:
|
||||
entry_attrs['ipamigrationenabled'] = 'FALSE'
|
||||
if 'ipadefaultprimarygroup' in entry_attrs:
|
||||
group=entry_attrs['ipadefaultprimarygroup']
|
||||
try:
|
||||
api.Command['group_show'](group)
|
||||
except errors.NotFound:
|
||||
raise errors.NotFound(message=unicode("The group doesn't exist"))
|
||||
return dn
|
||||
|
||||
api.register(config_mod)
|
||||
|
||||
Reference in new issue
Block a user