CS-15173: Additional Cluster is allowed to add with the same VSM IPaddress as the previous cluster

reviewed-by: Sateesh
Description:

	Missed deletion of cluster record in case of failure in
	validation of vsm:cluster mapping restriction.
This commit is contained in:
Vijayendra Bhamidipati 2012-05-31 23:45:40 -07:00
parent 26945718e7
commit 0e26608458
1 changed files with 1 additions and 0 deletions

View File

@ -445,6 +445,7 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
List<ClusterVSMMapVO> clusterList = _clusterVSMDao.listByVSMId(vsm.getId());
if (clusterList != null && !clusterList.isEmpty()) {
s_logger.error("Failed to add cluster: specified Nexus VSM is already associated with another cluster");
_clusterDao.remove(clusterId);
ResourceInUseException ex = new ResourceInUseException("Failed to add cluster: specified Nexus VSM is already associated with another cluster with specified Id");
ex.addProxyObject("cluster", clusterList.get(0).getClusterId(), "clusterId");
throw ex;