mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix list volume response to list datastore cluster name and id instead of child datastore
This commit is contained in:
parent
0a412ac6da
commit
85d440d973
@ -24,6 +24,8 @@ import javax.inject.Inject;
|
||||
import org.apache.cloudstack.api.ResponseObject.ResponseView;
|
||||
import org.apache.cloudstack.api.response.VolumeResponse;
|
||||
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -51,6 +53,8 @@ public class VolumeJoinDaoImpl extends GenericDaoBaseWithTagInformation<VolumeJo
|
||||
public AccountManager _accountMgr;
|
||||
@Inject
|
||||
private VmDiskStatisticsDao vmDiskStatsDao;
|
||||
@Inject
|
||||
private PrimaryDataStoreDao primaryDataStoreDao;
|
||||
|
||||
private final SearchBuilder<VolumeJoinVO> volSearch;
|
||||
|
||||
@ -220,6 +224,14 @@ public class VolumeJoinDaoImpl extends GenericDaoBaseWithTagInformation<VolumeJo
|
||||
String poolName = (poolId == null) ? "none" : volume.getPoolName();
|
||||
volResponse.setStoragePoolName(poolName);
|
||||
volResponse.setStoragePoolId(volume.getPoolUuid());
|
||||
if (poolId != null) {
|
||||
StoragePoolVO poolVO = primaryDataStoreDao.findById(poolId);
|
||||
if (poolVO != null && poolVO.getParent() != 0L) {
|
||||
StoragePoolVO datastoreClusterVO = primaryDataStoreDao.findById(poolVO.getParent());
|
||||
volResponse.setStoragePoolName(datastoreClusterVO.getName());
|
||||
volResponse.setStoragePoolId(datastoreClusterVO.getUuid());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
volResponse.setAttached(volume.getAttached());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user