diff --git a/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java index 26a18818dbfc..d23e2f6260f1 100644 --- a/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java @@ -180,10 +180,10 @@ private String getTemplateStatus(TemplateJoinVO template) { } } else if (template.getDownloadState() == Status.BYPASSED) { templateStatus = "Bypassed Secondary Storage"; - }else if (template.getErrorString()==null){ + } else if (template.getErrorString() == null) { templateStatus = template.getTemplateState().toString(); - }else { - templateStatus = template.getErrorString(); + } else { + templateStatus = template.getErrorString().trim(); } } else if (template.getDownloadState() == Status.DOWNLOADED) { templateStatus = "Download Complete";