Skip to content

Commit 8111b6c

Browse files
committed
server: set template type to ROUTING or USER if template type is not specified when upload a template
1 parent c3d6a8c commit 8111b6c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/src/main/java/com/cloud/template/TemplateManagerImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,6 +2407,8 @@ public TemplateType validateTemplateType(BaseCmd cmd, boolean isAdmin, boolean i
24072407
throw new InvalidParameterValueException(String.format("Please specify a valid templatetype: %s",
24082408
org.apache.commons.lang3.StringUtils.join(",", TemplateType.values())));
24092409
}
2410+
} else if (cmd instanceof GetUploadParamsForTemplateCmd) {
2411+
templateType = ((GetUploadParamsForTemplateCmd) cmd).isRoutingType() ? TemplateType.ROUTING : TemplateType.USER;
24102412
}
24112413
if (templateType != null) {
24122414
if (isRoutingType != null && (TemplateType.ROUTING.equals(templateType) != isRoutingType)) {

0 commit comments

Comments
 (0)