mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-2305: [Automation] NPE: not able to create volume from snapshot
Signed off by : Nitin Mehta <nitin.mehta@citrix.com>
This commit is contained in:
parent
49faa002e2
commit
55c384651a
|
|
@ -878,14 +878,6 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
|
|||
size = diskOffering.getDiskSize();
|
||||
}
|
||||
|
||||
if(displayVolumeEnabled == null){
|
||||
displayVolumeEnabled = true;
|
||||
} else{
|
||||
if(!_accountMgr.isRootAdmin(caller.getType())){
|
||||
throw new PermissionDeniedException( "Cannot update parameter displayvolume, only admin permitted ");
|
||||
}
|
||||
}
|
||||
|
||||
if (!validateVolumeSizeRange(size)) {// convert size from mb to gb
|
||||
// for validation
|
||||
throw new InvalidParameterValueException(
|
||||
|
|
@ -917,6 +909,14 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
|
|||
_accountMgr.checkAccess(caller, null, true, snapshotCheck);
|
||||
}
|
||||
|
||||
if(displayVolumeEnabled == null){
|
||||
displayVolumeEnabled = true;
|
||||
} else{
|
||||
if(!_accountMgr.isRootAdmin(caller.getType())){
|
||||
throw new PermissionDeniedException( "Cannot update parameter displayvolume, only admin permitted ");
|
||||
}
|
||||
}
|
||||
|
||||
// Check that the resource limit for primary storage won't be exceeded
|
||||
_resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.primary_storage,
|
||||
new Long(size));
|
||||
|
|
|
|||
Loading…
Reference in New Issue