mirror of https://github.com/apache/cloudstack.git
server: fix checking disk offering access for snapshot volume (#3791)
Fixes #3783 As reported in the issue, creating volumes from pure snapshot fails with NPE. This is due to order of calls where disk offering access is checked before checking disk offering value. This PR fixes the same. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
75aa6e3659
commit
a71874682c
|
|
@ -673,8 +673,6 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
|||
zoneId = snapshotCheck.getDataCenterId();
|
||||
}
|
||||
|
||||
_configMgr.checkDiskOfferingAccess(null, diskOffering, _dcDao.findById(zoneId));
|
||||
|
||||
if (diskOffering == null) { // Pure snapshot is being used to create volume.
|
||||
diskOfferingId = snapshotCheck.getDiskOfferingId();
|
||||
diskOffering = _diskOfferingDao.findById(diskOfferingId);
|
||||
|
|
@ -689,6 +687,8 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
|||
}
|
||||
}
|
||||
|
||||
_configMgr.checkDiskOfferingAccess(null, diskOffering, _dcDao.findById(zoneId));
|
||||
|
||||
// check snapshot permissions
|
||||
_accountMgr.checkAccess(caller, null, true, snapshotCheck);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue