cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [cloudstack] branch master updated: CLOUDSTACK-9608: Errored State and Abandoned state Templates are not displayed on UI. (#1774)
Date Sat, 05 Aug 2017 22:10:30 GMT
This is an automated email from the ASF dual-hosted git repository.

bhaisaab pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new 3614f8a  CLOUDSTACK-9608: Errored State and Abandoned state Templates are not displayed
on UI. (#1774)
3614f8a is described below

commit 3614f8aae29f3e084671b5269d2429fa7f355978
Author: Mowgli <priyankparihar@users.noreply.github.com>
AuthorDate: Sun Aug 6 03:40:26 2017 +0530

    CLOUDSTACK-9608: Errored State and Abandoned state Templates are not displayed on UI.
(#1774)
    
    Errored and Abandoned Templates should also be displayed on UI so that user has the accessibility
to delete the template even before the clean up thread is run. Refer - CLOUDSTACK-9608
---
 server/src/com/cloud/api/query/QueryManagerImpl.java        | 3 ++-
 server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index 9ed1cde..1c5c70c 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -3092,6 +3092,7 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase
implements Q
         boolean showDomr = ((templateFilter != TemplateFilter.selfexecutable) &&
(templateFilter != TemplateFilter.featured));
         HypervisorType hypervisorType = HypervisorType.getType(cmd.getHypervisor());
 
+
         return searchForTemplatesInternal(id, cmd.getTemplateName(), cmd.getKeyword(), templateFilter,
false, null,
                 cmd.getPageSizeVal(), cmd.getStartIndex(), cmd.getZoneId(), hypervisorType,
showDomr,
                 cmd.listInReadyState(), permittedAccounts, caller, listProjectResourcesCriteria,
tags, showRemovedTmpl,
@@ -3355,7 +3356,7 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase
implements Q
         if (showRemovedTmpl) {
             uniqueTmplPair = _templateJoinDao.searchIncludingRemovedAndCount(sc, searchFilter);
         } else {
-            sc.addAnd("templateState", SearchCriteria.Op.IN, new State[]{State.Active, State.NotUploaded,
State.UploadInProgress});
+            sc.addAnd("templateState", SearchCriteria.Op.IN, new State[]{State.Active, State.UploadAbandoned,
State.UploadError, State.NotUploaded, State.UploadInProgress});
             uniqueTmplPair = _templateJoinDao.searchAndCount(sc, searchFilter);
         }
 
diff --git a/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
index 53f0429..67105d0 100644
--- a/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java
@@ -105,7 +105,9 @@ public class TemplateJoinDaoImpl extends GenericDaoBaseWithTagInformation<Templa
                 } else {
                     templateStatus = template.getDownloadPercent() + "% Downloaded";
                 }
-            } else {
+            }else if (template.getErrorString()==null){
+                templateStatus = template.getTemplateState().toString();
+            }else {
                 templateStatus = template.getErrorString();
             }
         } else if (template.getDownloadState() == VMTemplateHostVO.Status.DOWNLOADED) {
@@ -410,7 +412,7 @@ public class TemplateJoinDaoImpl extends GenericDaoBaseWithTagInformation<Templa
             }
             SearchCriteria<TemplateJoinVO> sc = tmpltIdPairSearch.create();
             if (!showRemoved) {
-                sc.setParameters("templateState", VirtualMachineTemplate.State.Active, VirtualMachineTemplate.State.NotUploaded,
VirtualMachineTemplate.State.UploadInProgress);
+                sc.setParameters("templateState", VirtualMachineTemplate.State.Active, VirtualMachineTemplate.State.UploadAbandoned,
VirtualMachineTemplate.State.UploadError ,VirtualMachineTemplate.State.NotUploaded, VirtualMachineTemplate.State.UploadInProgress);
             }
             sc.setParameters("tempZonePairIN", labels);
             List<TemplateJoinVO> vms = searchIncludingRemoved(sc, searchFilter, null,
false);

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].

Mime
View raw message