7777import com .cloud .user .Account ;
7878import com .cloud .user .AccountService ;
7979import com .cloud .utils .Pair ;
80+ import com .cloud .utils .StringUtils ;
8081import com .cloud .utils .db .Filter ;
8182import com .cloud .utils .db .SearchBuilder ;
8283import com .cloud .utils .db .SearchCriteria ;
@@ -162,9 +163,8 @@ protected TemplateJoinDaoImpl() {
162163 }
163164
164165 private String getTemplateStatus (TemplateJoinVO template ) {
165- String templateStatus = null ;
166+ String templateStatus = "Processing" ;
166167 if (template .getDownloadState () != Status .DOWNLOADED ) {
167- templateStatus = "Processing" ;
168168 if (template .getDownloadState () == Status .DOWNLOAD_IN_PROGRESS ) {
169169 if (template .getDownloadPercent () == 100 ) {
170170 templateStatus = "Installing Template" ;
@@ -173,10 +173,8 @@ private String getTemplateStatus(TemplateJoinVO template) {
173173 }
174174 } else if (template .getDownloadState () == Status .BYPASSED ) {
175175 templateStatus = "Bypassed Secondary Storage" ;
176- } else if (template .getErrorString () == null ) {
176+ } else if (StringUtils . isNotBlank ( template .getErrorString ()) ) {
177177 templateStatus = template .getTemplateState ().toString ();
178- } else {
179- templateStatus = template .getErrorString ().trim ();
180178 }
181179 } else if (template .getDownloadState () == Status .DOWNLOADED ) {
182180 templateStatus = "Download Complete" ;
0 commit comments