mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix equality check using != on objects
Cleanup in the code, removing dead code
This commit is contained in:
parent
2833366415
commit
4bf321bd03
@ -695,7 +695,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
||||
protected VolumeVO createVolumeFromSnapshot(VolumeVO volume, long snapshotId, Long vmId) throws StorageUnavailableException {
|
||||
VolumeInfo createdVolume = null;
|
||||
SnapshotVO snapshot = _snapshotDao.findById(snapshotId);
|
||||
long snapshotVolId = snapshot.getVolumeId();
|
||||
snapshot.getVolumeId();
|
||||
|
||||
UserVmVO vm = null;
|
||||
if (vmId != null) {
|
||||
@ -830,7 +830,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
||||
newSize = newDiskOffering.getDiskSize();
|
||||
}
|
||||
|
||||
if (volume.getSize() != newSize && !volume.getVolumeType().equals(Volume.Type.DATADISK)) {
|
||||
if (!volume.getSize().equals(newSize) && !volume.getVolumeType().equals(Volume.Type.DATADISK)) {
|
||||
throw new InvalidParameterValueException("Only data volumes can be resized via a new disk offering.");
|
||||
}
|
||||
|
||||
@ -1996,11 +1996,8 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
||||
}
|
||||
}
|
||||
|
||||
Upload.Mode extractMode;
|
||||
if (mode == null || (!mode.equals(Upload.Mode.FTP_UPLOAD.toString()) && !mode.equals(Upload.Mode.HTTP_DOWNLOAD.toString()))) {
|
||||
throw new InvalidParameterValueException("Please specify a valid extract Mode ");
|
||||
} else {
|
||||
extractMode = mode.equals(Upload.Mode.FTP_UPLOAD.toString()) ? Upload.Mode.FTP_UPLOAD : Upload.Mode.HTTP_DOWNLOAD;
|
||||
}
|
||||
|
||||
// Check if the url already exists
|
||||
@ -2009,14 +2006,12 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
||||
return volumeStoreRef.getExtractUrl();
|
||||
}
|
||||
|
||||
// Clean up code to remove all those previous uploadVO and uploadMonitor code. Previous code is trying to fake an async operation purely in
|
||||
// db table with uploadVO and async_job entry, but internal implementation is actually synchronous.
|
||||
StoragePool srcPool = (StoragePool)dataStoreMgr.getPrimaryDataStore(volume.getPoolId());
|
||||
dataStoreMgr.getPrimaryDataStore(volume.getPoolId());
|
||||
ImageStoreEntity secStore = (ImageStoreEntity)dataStoreMgr.getImageStore(zoneId);
|
||||
String secondaryStorageURL = secStore.getUri();
|
||||
secStore.getUri();
|
||||
|
||||
String value = _configDao.getValue(Config.CopyVolumeWait.toString());
|
||||
int copyvolumewait = NumbersUtil.parseInt(value, Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));
|
||||
NumbersUtil.parseInt(value, Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));
|
||||
// Copy volume from primary to secondary storage
|
||||
VolumeInfo srcVol = volFactory.getVolume(volume.getId());
|
||||
AsyncCallFuture<VolumeApiResult> cvAnswer = volService.copyVolume(srcVol, secStore);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user