Skip to content

Commit 4eb9666

Browse files
weizhouapacheLocharla, Sandeep
authored andcommitted
api: create/register/upload template with empty template tag (apache#12234)
1 parent 5d82125 commit 4eb9666

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
@@ -170,7 +170,7 @@ public Boolean isSshKeyEnabled() {
170170
}
171171

172172
public String getTemplateTag() {
173-
return templateTag;
173+
return StringUtils.isBlank(templateTag) ? null : templateTag;
174174
}
175175

176176
public boolean isDeployAsIs() {

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
@@ -279,7 +279,7 @@ public String getChecksum() {
279279
}
280280

281281
public String getTemplateTag() {
282-
return templateTag;
282+
return StringUtils.isBlank(templateTag) ? null : templateTag;
283283
}
284284

285285
public Map getDetails() {

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)