use of org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand in project ovirt-engine by oVirt.
the class CloneSingleCinderDiskCommandCallback method childCommandsExecutionEnded.
@Override
protected void childCommandsExecutionEnded(CommandBase<?> command, boolean anyFailed, List<Guid> childCmdIds, CommandExecutionStatus status, int completedChildren) {
BaseImagesCommand<ImagesContainterParametersBase> cloneCinderDiskCommand = (BaseImagesCommand<ImagesContainterParametersBase>) command;
ImagesContainterParametersBase parameters = cloneCinderDiskCommand.getParameters();
ImageStatus imageStatus = cloneCinderDiskCommand.getCinderBroker().getDiskStatus(parameters.getDestinationImageId());
DiskImage disk = (CinderDisk) diskDao.get(parameters.getContainerId());
if (imageStatus != null && imageStatus != disk.getImageStatus()) {
switch(imageStatus) {
case OK:
setCommandEndStatus(command, false, status, childCmdIds);
break;
case ILLEGAL:
setCommandEndStatus(command, true, status, childCmdIds);
break;
}
}
}
Aggregations