mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-4116: don't update db if hypervisor storage processor does
not return volume size.
This commit is contained in:
parent
923c4fd60f
commit
0243f043cb
|
|
@ -471,7 +471,9 @@ public class VolumeObject implements VolumeInfo {
|
|||
VolumeVO vol = this.volumeDao.findById(this.getId());
|
||||
VolumeObjectTO newVol = (VolumeObjectTO) cpyAnswer.getNewData();
|
||||
vol.setPath(newVol.getPath());
|
||||
vol.setSize(newVol.getSize());
|
||||
if (newVol.getSize() != null) {
|
||||
vol.setSize(newVol.getSize());
|
||||
}
|
||||
vol.setPoolId(this.getDataStore().getId());
|
||||
volumeDao.update(vol.getId(), vol);
|
||||
} else if (answer instanceof CreateObjectAnswer) {
|
||||
|
|
@ -479,7 +481,9 @@ public class VolumeObject implements VolumeInfo {
|
|||
VolumeObjectTO newVol = (VolumeObjectTO) createAnswer.getData();
|
||||
VolumeVO vol = this.volumeDao.findById(this.getId());
|
||||
vol.setPath(newVol.getPath());
|
||||
vol.setSize(newVol.getSize());
|
||||
if (newVol.getSize() != null) {
|
||||
vol.setSize(newVol.getSize());
|
||||
}
|
||||
vol.setPoolId(this.getDataStore().getId());
|
||||
volumeDao.update(vol.getId(), vol);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue