java: fix one typo in many files (#11284)

This commit is contained in:
John Bampton 2025-09-18 02:35:38 +10:00 committed by GitHub
parent 6eb27da5e4
commit 0108ffd1b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 45 additions and 45 deletions

View File

@ -21,7 +21,7 @@ package com.cloud.storage.resource;
import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand; import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand;
import org.apache.cloudstack.storage.command.AttachCommand; import org.apache.cloudstack.storage.command.AttachCommand;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.command.CopyCommand; import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.command.CreateObjectCommand; import org.apache.cloudstack.storage.command.CreateObjectCommand;
import org.apache.cloudstack.storage.command.DeleteCommand; import org.apache.cloudstack.storage.command.DeleteCommand;
@ -82,7 +82,7 @@ public interface StorageProcessor {
Answer copyVolumeFromPrimaryToPrimary(CopyCommand cmd); Answer copyVolumeFromPrimaryToPrimary(CopyCommand cmd);
public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplainceCommand cmd); public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplianceCommand cmd);
public Answer syncVolumePath(SyncVolumePathCommand cmd); public Answer syncVolumePath(SyncVolumePathCommand cmd);
} }

View File

@ -21,7 +21,7 @@ package com.cloud.storage.resource;
import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand; import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand;
import org.apache.cloudstack.storage.command.AttachCommand; import org.apache.cloudstack.storage.command.AttachCommand;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.command.CopyCommand; import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.command.CreateObjectAnswer; import org.apache.cloudstack.storage.command.CreateObjectAnswer;
import org.apache.cloudstack.storage.command.CreateObjectCommand; import org.apache.cloudstack.storage.command.CreateObjectCommand;
@ -79,8 +79,8 @@ public class StorageSubsystemCommandHandlerBase implements StorageSubsystemComma
return processor.resignature((ResignatureCommand) command); return processor.resignature((ResignatureCommand) command);
} else if (command instanceof DirectDownloadCommand) { } else if (command instanceof DirectDownloadCommand) {
return processor.handleDownloadTemplateToPrimaryStorage((DirectDownloadCommand) command); return processor.handleDownloadTemplateToPrimaryStorage((DirectDownloadCommand) command);
} else if (command instanceof CheckDataStoreStoragePolicyComplainceCommand) { } else if (command instanceof CheckDataStoreStoragePolicyComplianceCommand) {
return processor.checkDataStoreStoragePolicyCompliance((CheckDataStoreStoragePolicyComplainceCommand) command); return processor.checkDataStoreStoragePolicyCompliance((CheckDataStoreStoragePolicyComplianceCommand) command);
} else if (command instanceof SyncVolumePathCommand) { } else if (command instanceof SyncVolumePathCommand) {
return processor.syncVolumePath((SyncVolumePathCommand) command); return processor.syncVolumePath((SyncVolumePathCommand) command);
} else if (command instanceof QuerySnapshotZoneCopyCommand) { } else if (command instanceof QuerySnapshotZoneCopyCommand) {

View File

@ -21,12 +21,12 @@ package org.apache.cloudstack.storage.command;
import com.cloud.agent.api.to.StorageFilerTO; import com.cloud.agent.api.to.StorageFilerTO;
public class CheckDataStoreStoragePolicyComplainceCommand extends StorageSubSystemCommand { public class CheckDataStoreStoragePolicyComplianceCommand extends StorageSubSystemCommand {
String storagePolicyId; String storagePolicyId;
private StorageFilerTO storagePool; private StorageFilerTO storagePool;
public CheckDataStoreStoragePolicyComplainceCommand(String storagePolicyId, StorageFilerTO storagePool) { public CheckDataStoreStoragePolicyComplianceCommand(String storagePolicyId, StorageFilerTO storagePool) {
super(); super();
this.storagePolicyId = storagePolicyId; this.storagePolicyId = storagePolicyId;

View File

@ -378,7 +378,7 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement
return false; return false;
} }
} catch (StorageUnavailableException e) { } catch (StorageUnavailableException e) {
logger.warn(String.format("Could not verify storage policy complaince against storage pool %s due to exception %s", pool.getUuid(), e.getMessage())); logger.warn(String.format("Could not verify storage policy compliance against storage pool %s due to exception %s", pool.getUuid(), e.getMessage()));
return false; return false;
} }
} }

View File

@ -62,7 +62,7 @@ import org.apache.cloudstack.direct.download.DirectTemplateDownloader;
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
import org.apache.cloudstack.storage.command.AttachAnswer; import org.apache.cloudstack.storage.command.AttachAnswer;
import org.apache.cloudstack.storage.command.AttachCommand; import org.apache.cloudstack.storage.command.AttachCommand;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.command.CopyCmdAnswer; import org.apache.cloudstack.storage.command.CopyCmdAnswer;
import org.apache.cloudstack.storage.command.CopyCommand; import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.command.CreateObjectAnswer; import org.apache.cloudstack.storage.command.CreateObjectAnswer;
@ -3116,8 +3116,8 @@ public class KVMStorageProcessor implements StorageProcessor {
} }
@Override @Override
public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplainceCommand cmd) { public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplianceCommand cmd) {
logger.info("'CheckDataStoreStoragePolicyComplainceCommand' not currently applicable for KVMStorageProcessor"); logger.info("'CheckDataStoreStoragePolicyComplianceCommand' not currently applicable for KVMStorageProcessor");
return new Answer(cmd,false,"Not currently applicable for KVMStorageProcessor"); return new Answer(cmd,false,"Not currently applicable for KVMStorageProcessor");
} }

View File

@ -24,7 +24,7 @@ import java.util.UUID;
import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand; import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand;
import org.apache.cloudstack.storage.command.AttachAnswer; import org.apache.cloudstack.storage.command.AttachAnswer;
import org.apache.cloudstack.storage.command.AttachCommand; import org.apache.cloudstack.storage.command.AttachCommand;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.command.CopyCmdAnswer; import org.apache.cloudstack.storage.command.CopyCmdAnswer;
import org.apache.cloudstack.storage.command.CopyCommand; import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.command.CreateObjectAnswer; import org.apache.cloudstack.storage.command.CreateObjectAnswer;
@ -830,8 +830,8 @@ public class Ovm3StorageProcessor implements StorageProcessor {
} }
@Override @Override
public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplainceCommand cmd) { public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplianceCommand cmd) {
logger.info("'CheckDataStoreStoragePolicyComplainceCommand' not applicable used for Ovm3StorageProcessor"); logger.info("'CheckDataStoreStoragePolicyComplianceCommand' not applicable used for Ovm3StorageProcessor");
return new Answer(cmd,false,"Not applicable used for Ovm3StorageProcessor"); return new Answer(cmd,false,"Not applicable used for Ovm3StorageProcessor");
} }

View File

@ -32,7 +32,7 @@ import org.apache.cloudstack.storage.command.CopyCmdAnswer;
import org.apache.cloudstack.storage.command.CopyCommand; import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.command.CreateObjectAnswer; import org.apache.cloudstack.storage.command.CreateObjectAnswer;
import org.apache.cloudstack.storage.command.CreateObjectCommand; import org.apache.cloudstack.storage.command.CreateObjectCommand;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.command.DeleteCommand; import org.apache.cloudstack.storage.command.DeleteCommand;
import org.apache.cloudstack.storage.command.DettachAnswer; import org.apache.cloudstack.storage.command.DettachAnswer;
import org.apache.cloudstack.storage.command.DettachCommand; import org.apache.cloudstack.storage.command.DettachCommand;
@ -274,7 +274,7 @@ public class SimulatorStorageProcessor implements StorageProcessor {
} }
@Override @Override
public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplainceCommand cmd) { public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplianceCommand cmd) {
return new Answer(cmd, true, null); return new Answer(cmd, true, null);
} }

View File

@ -60,7 +60,7 @@ import org.apache.cloudstack.framework.config.Configurable;
import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
import org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl; import org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl;
import org.apache.cloudstack.management.ManagementServerHost; import org.apache.cloudstack.management.ManagementServerHost;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.cloudstack.utils.identity.ManagementServerNode; import org.apache.cloudstack.utils.identity.ManagementServerNode;
@ -1574,7 +1574,7 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
continue; continue;
} }
Collections.shuffle(hostIds); Collections.shuffle(hostIds);
CheckDataStoreStoragePolicyComplainceCommand command = new CheckDataStoreStoragePolicyComplainceCommand(storagePolicy.getPolicyId(), storageFilerTO); CheckDataStoreStoragePolicyComplianceCommand command = new CheckDataStoreStoragePolicyComplianceCommand(storagePolicy.getPolicyId(), storageFilerTO);
long targetHostId = hypervisorGuruManager.getGuruProcessedCommandTargetHost(hostIds.get(0), command); long targetHostId = hypervisorGuruManager.getGuruProcessedCommandTargetHost(hostIds.get(0), command);
try { try {
Answer answer = _agentMgr.send(targetHostId, command); Answer answer = _agentMgr.send(targetHostId, command);

View File

@ -37,7 +37,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand; import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand;
import org.apache.cloudstack.storage.command.AttachAnswer; import org.apache.cloudstack.storage.command.AttachAnswer;
import org.apache.cloudstack.storage.command.AttachCommand; import org.apache.cloudstack.storage.command.AttachCommand;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.command.CopyCmdAnswer; import org.apache.cloudstack.storage.command.CopyCmdAnswer;
import org.apache.cloudstack.storage.command.CopyCommand; import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.command.CreateObjectAnswer; import org.apache.cloudstack.storage.command.CreateObjectAnswer;
@ -3776,7 +3776,7 @@ public class VmwareStorageProcessor implements StorageProcessor {
} }
@Override @Override
public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplainceCommand cmd) { public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplianceCommand cmd) {
String primaryStorageNameLabel = cmd.getStoragePool().getUuid(); String primaryStorageNameLabel = cmd.getStoragePool().getUuid();
String storagePolicyId = cmd.getStoragePolicyId(); String storagePolicyId = cmd.getStoragePolicyId();
VmwareContext context = hostService.getServiceContext(cmd); VmwareContext context = hostService.getServiceContext(cmd);
@ -3792,14 +3792,14 @@ public class VmwareStorageProcessor implements StorageProcessor {
DatastoreMO primaryDsMo = new DatastoreMO(hyperHost.getContext(), morPrimaryDs); DatastoreMO primaryDsMo = new DatastoreMO(hyperHost.getContext(), morPrimaryDs);
boolean isDatastoreStoragePolicyComplaint = primaryDsMo.isDatastoreStoragePolicyComplaint(storagePolicyId); boolean isDatastoreStoragePolicyComplaint = primaryDsMo.isDatastoreStoragePolicyComplaint(storagePolicyId);
String failedMessage = String.format("DataStore %s is not complaince with storage policy id %s", primaryStorageNameLabel, storagePolicyId); String failedMessage = String.format("DataStore %s is not compliance with storage policy id %s", primaryStorageNameLabel, storagePolicyId);
if (!isDatastoreStoragePolicyComplaint) if (!isDatastoreStoragePolicyComplaint)
return new Answer(cmd, isDatastoreStoragePolicyComplaint, failedMessage); return new Answer(cmd, isDatastoreStoragePolicyComplaint, failedMessage);
else else
return new Answer(cmd, isDatastoreStoragePolicyComplaint, null); return new Answer(cmd, isDatastoreStoragePolicyComplaint, null);
} catch (Throwable e) { } catch (Throwable e) {
hostService.createLogMessageException(e, cmd); hostService.createLogMessageException(e, cmd);
String details = String.format("Exception while checking if datastore [%s] is storage policy [%s] complaince due to: [%s]", primaryStorageNameLabel, storagePolicyId, VmwareHelper.getExceptionMessage(e)); String details = String.format("Exception while checking if datastore [%s] is storage policy [%s] compliance due to: [%s]", primaryStorageNameLabel, storagePolicyId, VmwareHelper.getExceptionMessage(e));
return new Answer(cmd, false, details); return new Answer(cmd, false, details);
} }
} }

View File

@ -36,7 +36,7 @@ import java.util.UUID;
import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand; import org.apache.cloudstack.agent.directdownload.DirectDownloadCommand;
import org.apache.cloudstack.storage.command.AttachAnswer; import org.apache.cloudstack.storage.command.AttachAnswer;
import org.apache.cloudstack.storage.command.AttachCommand; import org.apache.cloudstack.storage.command.AttachCommand;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.command.CopyCmdAnswer; import org.apache.cloudstack.storage.command.CopyCmdAnswer;
import org.apache.cloudstack.storage.command.CopyCommand; import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.command.CreateObjectAnswer; import org.apache.cloudstack.storage.command.CreateObjectAnswer;
@ -221,8 +221,8 @@ public class XenServerStorageProcessor implements StorageProcessor {
} }
@Override @Override
public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplainceCommand cmd) { public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplianceCommand cmd) {
logger.info("'CheckDataStoreStoragePolicyComplainceCommand' not applicable used for XenServerStorageProcessor"); logger.info("'CheckDataStoreStoragePolicyComplianceCommand' not applicable used for XenServerStorageProcessor");
return new Answer(cmd,false,"Not applicable used for XenServerStorageProcessor"); return new Answer(cmd,false,"Not applicable used for XenServerStorageProcessor");
} }

View File

@ -27,7 +27,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.command.CopyCmdAnswer; import org.apache.cloudstack.storage.command.CopyCmdAnswer;
import org.apache.cloudstack.storage.command.CopyCommand; import org.apache.cloudstack.storage.command.CopyCommand;
import org.apache.cloudstack.storage.command.SyncVolumePathCommand; import org.apache.cloudstack.storage.command.SyncVolumePathCommand;
@ -919,8 +919,8 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
} }
@Override @Override
public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplainceCommand cmd) { public Answer checkDataStoreStoragePolicyCompliance(CheckDataStoreStoragePolicyComplianceCommand cmd) {
logger.info("'CheckDataStoreStoragePolicyComplainceCommand' not applicable used for XenServerStorageProcessor"); logger.info("'CheckDataStoreStoragePolicyComplianceCommand' not applicable used for XenServerStorageProcessor");
return new Answer(cmd,false,"Not applicable used for XenServerStorageProcessor"); return new Answer(cmd,false,"Not applicable used for XenServerStorageProcessor");
} }

View File

@ -1538,12 +1538,12 @@ StateListener<State, VirtualMachine.Event, VirtualMachine>, Configurable {
hostCanAccessPool = true; hostCanAccessPool = true;
if (potentialHost.getHypervisorType() == HypervisorType.VMware) { if (potentialHost.getHypervisorType() == HypervisorType.VMware) {
try { try {
boolean isStoragePoolStoragepolicyComplaince = _storageMgr.isStoragePoolCompliantWithStoragePolicy(volumeDiskProfilePair, storagePool); boolean isStoragePoolStoragepolicyCompliance = _storageMgr.isStoragePoolCompliantWithStoragePolicy(volumeDiskProfilePair, storagePool);
if (!isStoragePoolStoragepolicyComplaince) { if (!isStoragePoolStoragepolicyCompliance) {
continue; continue;
} }
} catch (StorageUnavailableException e) { } catch (StorageUnavailableException e) {
logger.warn("Could not verify storage policy complaince against storage pool {} due to exception {}", storagePool, e.getMessage()); logger.warn("Could not verify storage policy compliance against storage pool {} due to exception {}", storagePool, e.getMessage());
continue; continue;
} }
haveEnoughSpace = true; haveEnoughSpace = true;
@ -1577,12 +1577,12 @@ StateListener<State, VirtualMachine.Event, VirtualMachine>, Configurable {
List<Pair<Volume, DiskProfile>> volumeDiskProfilePair = getVolumeDiskProfilePairs(requestVolumes); List<Pair<Volume, DiskProfile>> volumeDiskProfilePair = getVolumeDiskProfilePairs(requestVolumes);
if (potentialHost.getHypervisorType() == HypervisorType.VMware) { if (potentialHost.getHypervisorType() == HypervisorType.VMware) {
try { try {
boolean isStoragePoolStoragepolicyComplaince = _storageMgr.isStoragePoolCompliantWithStoragePolicy(volumeDiskProfilePair, potentialSPool); boolean isStoragePoolStoragepolicyCompliance = _storageMgr.isStoragePoolCompliantWithStoragePolicy(volumeDiskProfilePair, potentialSPool);
if (!isStoragePoolStoragepolicyComplaince) { if (!isStoragePoolStoragepolicyCompliance) {
continue; continue;
} }
} catch (StorageUnavailableException e) { } catch (StorageUnavailableException e) {
logger.warn("Could not verify storage policy complaince against storage pool {} due to exception {}", potentialSPool, e.getMessage()); logger.warn("Could not verify storage policy compliance against storage pool {} due to exception {}", potentialSPool, e.getMessage());
continue; continue;
} }
} }

View File

@ -122,7 +122,7 @@ import org.apache.cloudstack.secstorage.HeuristicVO;
import org.apache.cloudstack.secstorage.dao.SecondaryStorageHeuristicDao; import org.apache.cloudstack.secstorage.dao.SecondaryStorageHeuristicDao;
import org.apache.cloudstack.secstorage.heuristics.Heuristic; import org.apache.cloudstack.secstorage.heuristics.Heuristic;
import org.apache.cloudstack.secstorage.heuristics.HeuristicType; import org.apache.cloudstack.secstorage.heuristics.HeuristicType;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.command.DettachCommand; import org.apache.cloudstack.storage.command.DettachCommand;
import org.apache.cloudstack.storage.command.SyncVolumePathAnswer; import org.apache.cloudstack.storage.command.SyncVolumePathAnswer;
import org.apache.cloudstack.storage.command.SyncVolumePathCommand; import org.apache.cloudstack.storage.command.SyncVolumePathCommand;
@ -3614,7 +3614,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
} }
try { try {
StorageFilerTO storageFilerTO = new StorageFilerTO(pool); StorageFilerTO storageFilerTO = new StorageFilerTO(pool);
CheckDataStoreStoragePolicyComplainceCommand cmd = new CheckDataStoreStoragePolicyComplainceCommand(storagePolicyVO.getPolicyId(), storageFilerTO); CheckDataStoreStoragePolicyComplianceCommand cmd = new CheckDataStoreStoragePolicyComplianceCommand(storagePolicyVO.getPolicyId(), storageFilerTO);
long targetHostId = _hvGuruMgr.getGuruProcessedCommandTargetHost(hostIds.get(0), cmd); long targetHostId = _hvGuruMgr.getGuruProcessedCommandTargetHost(hostIds.get(0), cmd);
return _agentMgr.send(targetHostId, cmd); return _agentMgr.send(targetHostId, cmd);
} catch (AgentUnavailableException e) { } catch (AgentUnavailableException e) {

View File

@ -3507,8 +3507,8 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
if (hypervisorType.equals(HypervisorType.VMware)) { if (hypervisorType.equals(HypervisorType.VMware)) {
try { try {
boolean isStoragePoolStoragepolicyComplaince = storageMgr.isStoragePoolCompliantWithStoragePolicy(Arrays.asList(volumeDiskProfilePair), destPool); boolean isStoragePoolStoragepolicyCompliance = storageMgr.isStoragePoolCompliantWithStoragePolicy(Arrays.asList(volumeDiskProfilePair), destPool);
if (!isStoragePoolStoragepolicyComplaince) { if (!isStoragePoolStoragepolicyCompliance) {
throw new CloudRuntimeException(String.format("Storage pool %s is not storage policy compliance with the volume %s", poolUuid, vol.getUuid())); throw new CloudRuntimeException(String.format("Storage pool %s is not storage policy compliance with the volume %s", poolUuid, vol.getUuid()));
} }
} catch (StorageUnavailableException e) { } catch (StorageUnavailableException e) {

View File

@ -43,7 +43,7 @@ import org.apache.cloudstack.framework.config.ConfigDepot;
import org.apache.cloudstack.framework.config.ConfigKey; import org.apache.cloudstack.framework.config.ConfigKey;
import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
import org.apache.cloudstack.resourcedetail.dao.DiskOfferingDetailsDao; import org.apache.cloudstack.resourcedetail.dao.DiskOfferingDetailsDao;
import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplainceCommand; import org.apache.cloudstack.storage.command.CheckDataStoreStoragePolicyComplianceCommand;
import org.apache.cloudstack.storage.datastore.db.ObjectStoreDao; import org.apache.cloudstack.storage.datastore.db.ObjectStoreDao;
import org.apache.cloudstack.storage.datastore.db.ObjectStoreVO; import org.apache.cloudstack.storage.datastore.db.ObjectStoreVO;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
@ -453,7 +453,7 @@ public class StorageManagerImplTest {
} }
try { try {
Mockito.doReturn(new com.cloud.agent.api.Answer( Mockito.doReturn(new com.cloud.agent.api.Answer(
Mockito.mock(CheckDataStoreStoragePolicyComplainceCommand.class))) Mockito.mock(CheckDataStoreStoragePolicyComplianceCommand.class)))
.when(storageManagerImpl).getCheckDatastorePolicyComplianceAnswer("policy", pool); .when(storageManagerImpl).getCheckDatastorePolicyComplianceAnswer("policy", pool);
assertTrue(storageManagerImpl.isStoragePoolCompliantWithStoragePolicy(1L, pool)); assertTrue(storageManagerImpl.isStoragePoolCompliantWithStoragePolicy(1L, pool));
} catch (StorageUnavailableException e) { } catch (StorageUnavailableException e) {
@ -461,7 +461,7 @@ public class StorageManagerImplTest {
} }
try { try {
com.cloud.agent.api.Answer answer = com.cloud.agent.api.Answer answer =
new com.cloud.agent.api.Answer(Mockito.mock(CheckDataStoreStoragePolicyComplainceCommand.class), new com.cloud.agent.api.Answer(Mockito.mock(CheckDataStoreStoragePolicyComplianceCommand.class),
false, ""); false, "");
Mockito.doReturn(answer) Mockito.doReturn(answer)
.when(storageManagerImpl).getCheckDatastorePolicyComplianceAnswer("policy", pool); .when(storageManagerImpl).getCheckDatastorePolicyComplianceAnswer("policy", pool);
@ -502,7 +502,7 @@ public class StorageManagerImplTest {
.thenReturn(policy); .thenReturn(policy);
Mockito.doReturn(new ArrayList<>(List.of(1L, 2L))).when(storageManagerImpl).getUpHostsInPool(Mockito.anyLong()); Mockito.doReturn(new ArrayList<>(List.of(1L, 2L))).when(storageManagerImpl).getUpHostsInPool(Mockito.anyLong());
Mockito.when(hvGuruMgr.getGuruProcessedCommandTargetHost(Mockito.anyLong(), Mockito.when(hvGuruMgr.getGuruProcessedCommandTargetHost(Mockito.anyLong(),
Mockito.any(CheckDataStoreStoragePolicyComplainceCommand.class))).thenReturn(1L); Mockito.any(CheckDataStoreStoragePolicyComplianceCommand.class))).thenReturn(1L);
try { try {
Mockito.when(agentManager.send(Mockito.anyLong(), Mockito.any(Command.class))) Mockito.when(agentManager.send(Mockito.anyLong(), Mockito.any(Command.class)))
.thenThrow(AgentUnavailableException.class); .thenThrow(AgentUnavailableException.class);
@ -529,12 +529,12 @@ public class StorageManagerImplTest {
.thenReturn(policy); .thenReturn(policy);
Mockito.doReturn(new ArrayList<>(List.of(1L, 2L))).when(storageManagerImpl).getUpHostsInPool(Mockito.anyLong()); Mockito.doReturn(new ArrayList<>(List.of(1L, 2L))).when(storageManagerImpl).getUpHostsInPool(Mockito.anyLong());
Mockito.when(hvGuruMgr.getGuruProcessedCommandTargetHost(Mockito.anyLong(), Mockito.when(hvGuruMgr.getGuruProcessedCommandTargetHost(Mockito.anyLong(),
Mockito.any(CheckDataStoreStoragePolicyComplainceCommand.class))).thenReturn(1L); Mockito.any(CheckDataStoreStoragePolicyComplianceCommand.class))).thenReturn(1L);
try { try {
Mockito.when(agentManager.send(Mockito.anyLong(), Mockito.when(agentManager.send(Mockito.anyLong(),
Mockito.any(CheckDataStoreStoragePolicyComplainceCommand.class))) Mockito.any(CheckDataStoreStoragePolicyComplianceCommand.class)))
.thenReturn(new com.cloud.agent.api.Answer( .thenReturn(new com.cloud.agent.api.Answer(
Mockito.mock(CheckDataStoreStoragePolicyComplainceCommand.class))); Mockito.mock(CheckDataStoreStoragePolicyComplianceCommand.class)));
} catch (AgentUnavailableException | OperationTimedoutException e) { } catch (AgentUnavailableException | OperationTimedoutException e) {
Assert.fail(e.getMessage()); Assert.fail(e.getMessage());
} }