Skip to content

Commit ca135a2

Browse files
weizhouapachedhslove
authored andcommitted
api: create/register/upload template with empty template tag (apache#12234)
1 parent 27b1f99 commit ca135a2

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public String getUrl() {
211211
}
212212

213213
public String getTemplateTag() {
214-
return templateTag;
214+
return StringUtils.isBlank(templateTag) ? null : templateTag;
215215
}
216216

217217
public Map getDetails() {

api/src/main/java/org/apache/cloudstack/api/command/user/template/GetUploadParamsForTemplateCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public Boolean isSshKeyEnabled() {
173173
}
174174

175175
public String getTemplateTag() {
176-
return templateTag;
176+
return StringUtils.isBlank(templateTag) ? null : templateTag;
177177
}
178178

179179
public Boolean isKvdoEnable() {

api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public String getChecksum() {
323323
}
324324

325325
public String getTemplateTag() {
326-
return templateTag;
326+
return StringUtils.isBlank(templateTag) ? null : templateTag;
327327
}
328328

329329
public Long getZoneId() {

server/src/main/java/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ protected Map<String, Object> createProxyInstance(long dataCenterId, List<VMTemp
736736
logger.debug("Unable to allocate proxy {} with {} in {} due to [{}]. Retrying with another template", proxy, template, dc, e.getMessage(), e);
737737
continue;
738738
}
739-
throw new CloudRuntimeException("Failed to allocate proxy [%s] in zone [%s] with available templates", e);
739+
throw new CloudRuntimeException(String.format("Failed to allocate proxy [%s] in zone [%s] with available templates", proxy, dc), e);
740740
}
741741
}
742742

0 commit comments

Comments
 (0)