CLOUDSTACK-10269: On deletion of role set name to null (#2444)

During deletion of role, set name to null. This fixes concurrent
exception issue where previously it would rename the deleted role
with a timestamp.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2018-02-09 09:49:23 +01:00 committed by dahn
parent 123c20dc57
commit 0befb2cceb

View File

@ -18,7 +18,6 @@ package org.apache.cloudstack.acl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import javax.inject.Inject;
@ -172,7 +171,7 @@ public class RoleManagerImpl extends ManagerBase implements RoleService, Configu
}
if (roleDao.remove(role.getId())) {
RoleVO roleVO = roleDao.findByIdIncludingRemoved(role.getId());
roleVO.setName(role.getName() + "-deleted-" + new Date());
roleVO.setName(null);
return roleDao.update(role.getId(), roleVO);
}
return false;