Fix CLOUDSTACK-2485: ClassCastException in extracting ISO.

This commit is contained in:
Min Chen 2013-05-14 14:56:26 -07:00
parent 95e7e270d4
commit 252f384e89
3 changed files with 6 additions and 3 deletions

View File

@ -34,4 +34,5 @@ public interface ImageStoreEntity extends DataStore, ImageStore {
SnapshotInfo getSnapshot(long snapshotId);
boolean exists(DataObject object);
Set<TemplateInfo> listTemplates();
String getMountPoint(); // get the mount point on ssvm.
}

View File

@ -177,8 +177,9 @@ public class ImageStoreImpl implements ImageStoreEntity {
return getDriver().getStoreTO(this);
}
public ImageStoreVO getImageStoreVO(){
return this.imageDataStoreVO;
@Override
public String getMountPoint(){
return this.imageDataStoreVO.getParent();
}
}

View File

@ -38,6 +38,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
import org.apache.cloudstack.storage.datastore.db.ImageStoreVO;
import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
@ -229,7 +230,7 @@ public class UploadMonitorImpl extends ManagerBase implements UploadMonitor {
// Create Symlink at ssvm
String path = vmTemplateHost.getInstallPath();
String uuid = UUID.randomUUID().toString() + "." + template.getFormat().getFileExtension(); // adding "." + vhd/ova... etc.
CreateEntityDownloadURLCommand cmd = new CreateEntityDownloadURLCommand(((ImageStoreVO)store).getParent(), path, uuid);
CreateEntityDownloadURLCommand cmd = new CreateEntityDownloadURLCommand(((ImageStoreEntity)store).getMountPoint(), path, uuid);
Answer ans = ep.sendMessage(cmd);
if (ans == null || !ans.getResult()) {
errorString = "Unable to create a link for " +type+ " id:"+template.getId() + "," + ans.getDetails();