Skip to content

Commit 7f59577

Browse files
committed
Fix compilation error due to cherry-pick CLOUDSTACK-6569.
1 parent 3314e11 commit 7f59577

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

server/src/com/cloud/storage/VolumeApiServiceImpl.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,9 +1093,6 @@ public Volume attachVolumeToVM(Long vmId, Long volumeId, Long deviceId) {
10931093
throw new InvalidParameterValueException("Please specify a VM that is in the same zone as the volume.");
10941094
}
10951095

1096-
// permission check
1097-
_accountMgr.checkAccess(caller, null, true, volumeToAttach, vm);
1098-
10991096
// Check that the device ID is valid
11001097
if (deviceId != null) {
11011098
// validate ROOT volume type

server/test/com/cloud/storage/VolumeApiServiceImplTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727

2828
import javax.inject.Inject;
2929

30+
import org.junit.After;
31+
import org.junit.Before;
32+
import org.junit.Rule;
33+
import org.junit.Test;
34+
import org.junit.rules.ExpectedException;
35+
import org.mockito.Mock;
36+
import org.mockito.Mockito;
37+
import org.mockito.MockitoAnnotations;
38+
3039
import org.apache.cloudstack.acl.ControlledEntity;
3140
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
3241
import org.apache.cloudstack.api.command.user.volume.DetachVolumeCmd;
@@ -39,14 +48,6 @@
3948
import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO;
4049
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
4150
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
42-
import org.junit.After;
43-
import org.junit.Before;
44-
import org.junit.Rule;
45-
import org.junit.Test;
46-
import org.junit.rules.ExpectedException;
47-
import org.mockito.Mock;
48-
import org.mockito.Mockito;
49-
import org.mockito.MockitoAnnotations;
5051

5152
import com.cloud.exception.InvalidParameterValueException;
5253
import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -232,7 +233,7 @@ public void setup() throws Exception {
232233
}
233234

234235
// helper methods mock
235-
doNothing().when(_svc._accountMgr).checkAccess(any(Account.class), any(AccessType.class), any(Boolean.class), any(ControlledEntity.class));
236+
doNothing().when(_svc._accountMgr).checkAccess(any(Account.class), any(AccessType.class), any(ControlledEntity.class));
236237
doNothing().when(_svc._jobMgr).updateAsyncJobAttachment(any(Long.class), any(String.class), any(Long.class));
237238
when(_svc._jobMgr.submitAsyncJob(any(AsyncJobVO.class), any(String.class), any(Long.class))).thenReturn(1L);
238239
}

0 commit comments

Comments
 (0)