Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2359,12 +2359,15 @@ else if (details != null && !details.isEmpty()) {

@Override
public TemplateType validateTemplateType(BaseCmd cmd, boolean isAdmin, boolean isCrossZones, HypervisorType hypervisorType) {
if (!(cmd instanceof UpdateTemplateCmd) && !(cmd instanceof RegisterTemplateCmd) && !(cmd instanceof GetUploadParamsForTemplateCmd)) {
if (!(cmd instanceof UpdateTemplateCmd) &&
!(cmd instanceof RegisterTemplateCmd) &&
!(cmd instanceof GetUploadParamsForTemplateCmd) &&
!(cmd instanceof GetUploadParamsForIsoCmd)) {
return null;
}
TemplateType templateType = null;
String newType = null;
Boolean isRoutingType = null;
String newType = TemplateType.USER.name();
Boolean isRoutingType = false;
if (cmd instanceof UpdateTemplateCmd) {
newType = ((UpdateTemplateCmd)cmd).getTemplateType();
isRoutingType = ((UpdateTemplateCmd)cmd).isRoutingType();
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -4392,7 +4392,7 @@ private UserVm getUncheckedUserVmResource(DataCenter zone, String hostName, Stri
}
}

if (template.getTemplateType().equals(TemplateType.SYSTEM) && !CKS_NODE.equals(vmType) && !SHAREDFSVM.equals(vmType)) {
if (TemplateType.SYSTEM.equals(template.getTemplateType()) && !CKS_NODE.equals(vmType) && !SHAREDFSVM.equals(vmType)) {
throw new InvalidParameterValueException(String.format("Unable to use system template %s to deploy a user vm", template));
}

Expand Down
Loading