mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.14' into 4.15
This commit is contained in:
commit
3a82392941
@ -487,6 +487,10 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
|
|||||||
throw new InvalidParameterValueException("Please specify a valid template.");
|
throw new InvalidParameterValueException("Please specify a valid template.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (template.getState() == VirtualMachineTemplate.State.NotUploaded || template.getState() == VirtualMachineTemplate.State.UploadInProgress) {
|
||||||
|
throw new InvalidParameterValueException("The template is either getting uploaded or it may be initiated shortly, please wait for it to be completed");
|
||||||
|
}
|
||||||
|
|
||||||
return new TemplateProfile(userId, template, zoneId);
|
return new TemplateProfile(userId, template, zoneId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -526,6 +530,10 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
|
|||||||
throw new InvalidParameterValueException("Please specify a valid iso.");
|
throw new InvalidParameterValueException("Please specify a valid iso.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (template.getState() == VirtualMachineTemplate.State.NotUploaded || template.getState() == VirtualMachineTemplate.State.UploadInProgress) {
|
||||||
|
throw new InvalidParameterValueException("The iso is either getting uploaded or it may be initiated shortly, please wait for it to be completed");
|
||||||
|
}
|
||||||
|
|
||||||
return new TemplateProfile(userId, template, zoneId);
|
return new TemplateProfile(userId, template, zoneId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2348,6 +2348,9 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||||||
File tmpltParent = null;
|
File tmpltParent = null;
|
||||||
if (tmpltPath.exists() && tmpltPath.isDirectory()) {
|
if (tmpltPath.exists() && tmpltPath.isDirectory()) {
|
||||||
tmpltParent = tmpltPath;
|
tmpltParent = tmpltPath;
|
||||||
|
} else if (absoluteTemplatePath.endsWith(File.separator + obj.getId())) {
|
||||||
|
// the path ends with <account id>/<template id>, if upload fails
|
||||||
|
tmpltParent = tmpltPath;
|
||||||
} else {
|
} else {
|
||||||
tmpltParent = tmpltPath.getParentFile();
|
tmpltParent = tmpltPath.getParentFile();
|
||||||
}
|
}
|
||||||
@ -2452,6 +2455,9 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||||||
if (volPath.exists() && volPath.isDirectory()) {
|
if (volPath.exists() && volPath.isDirectory()) {
|
||||||
// for vmware, absoluteVolumePath represents a directory where volume files are located.
|
// for vmware, absoluteVolumePath represents a directory where volume files are located.
|
||||||
tmpltParent = volPath;
|
tmpltParent = volPath;
|
||||||
|
} else if (absoluteVolumePath.endsWith(File.separator + obj.getId())) {
|
||||||
|
// the path ends with <account id>/<volume id>, if upload fails
|
||||||
|
tmpltParent = volPath;
|
||||||
} else {
|
} else {
|
||||||
// for other hypervisors, the volume .vhd or .qcow2 file path is passed
|
// for other hypervisors, the volume .vhd or .qcow2 file path is passed
|
||||||
tmpltParent = new File(absoluteVolumePath).getParentFile();
|
tmpltParent = new File(absoluteVolumePath).getParentFile();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user