Fixup updateSnapshotInfo failure due to forward merging (#8150)

Fixes build failures
This commit is contained in:
Vishesh 2023-10-26 17:14:11 +05:30 committed by GitHub
parent 587d1d7dba
commit a06f8a8763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -570,7 +570,7 @@ public class SnapshotManagerImpl extends MutualExclusiveIdsManagerBase implement
if ((storagePool.getPoolType() == StoragePoolType.NetworkFilesystem || storagePool.getPoolType() == StoragePoolType.Filesystem) && vmSnapshot.getType() == VMSnapshot.Type.Disk) {
List<VMSnapshotDetailsVO> vmSnapshotDetails = vmSnapshotDetailsDao.findDetails(vmSnapshotId, "kvmStorageSnapshot");
for (VMSnapshotDetailsVO vmSnapshotDetailsVO : vmSnapshotDetails) {
SnapshotInfo sInfo = snapshotDataFactory.getSnapshot(Long.parseLong(vmSnapshotDetailsVO.getValue()), DataStoreRole.Primary);
SnapshotInfo sInfo = snapshotDataFactory.getSnapshot(Long.parseLong(vmSnapshotDetailsVO.getValue()), storagePool.getId(), DataStoreRole.Primary);
if (sInfo.getVolumeId() == volumeId) {
snapshotOnPrimaryStore.setState(ObjectInDataStoreStateMachine.State.Ready);
snapshotOnPrimaryStore.setInstallPath(sInfo.getPath());

View File

@ -74,7 +74,7 @@ public class SnapshotManagerImplTest {
@Mock
SnapshotService snapshotService;
@Mock
SnapshotDataFactory snapshotDataFactory;
SnapshotDataFactory snapshotFactory;
@Mock
ResourceLimitService resourceLimitService;
@Mock
@ -269,7 +269,7 @@ public class SnapshotManagerImplTest {
Mockito.when(store.getId()).thenReturn(storeId);
Mockito.when(dataStoreManager.getDataStore(storeId, DataStoreRole.Image)).thenReturn(store);
Mockito.when(snapshotStoreDao.listReadyBySnapshot(snapshotId, DataStoreRole.Image)).thenReturn(snapshotStoreList);
Mockito.when(snapshotDataFactory.getSnapshot(Mockito.anyLong(), Mockito.any())).thenReturn(Mockito.mock(SnapshotInfo.class));
Mockito.when(snapshotFactory.getSnapshot(Mockito.anyLong(), Mockito.any())).thenReturn(Mockito.mock(SnapshotInfo.class));
CreateCmdResult result = Mockito.mock(CreateCmdResult.class);
Mockito.when(result.isFailed()).thenReturn(false);
Mockito.when(result.getPath()).thenReturn("SOMEPATH");