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:
Sanjay Tripathi 2013-05-21 11:49:42 +05:30 committed by Nitin Mehta
parent 49faa002e2
commit 55c384651a
1 changed files with 8 additions and 8 deletions

View File

@ -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));