You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2012/09/12 02:38:58 UTC

[43/50] [abbrv] git commit: only check ISO which is downloaded status

only check ISO which is downloaded status


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/efd0905f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/efd0905f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/efd0905f

Branch: refs/heads/javelin
Commit: efd0905fbd72419386c6b570b92cab1dff851f36
Parents: e2e0ec6
Author: Anthony Xu <an...@cloud.com>
Authored: Mon Sep 10 13:30:25 2012 -0700
Committer: Alex Huang <al...@citrix.com>
Committed: Tue Sep 11 17:37:58 2012 -0700

----------------------------------------------------------------------
 .../src/com/cloud/storage/StorageManagerImpl.java  |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/efd0905f/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 50a78db..4425b71 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -1098,9 +1098,10 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
         List<HostVO> storageHosts = _resourceMgr.listAllHostsInOneZoneByType(Host.Type.SecondaryStorage, dataCenterId);
         if (storageHosts != null) {
             for (HostVO storageHost : storageHosts) {
-                VMTemplateHostVO templateHostVO = _vmTemplateHostDao.findByHostTemplate(storageHost.getId(), templateId);
-                if (templateHostVO != null) {
-                    isoPath = storageHost.getStorageUrl() + "/" + templateHostVO.getInstallPath();
+                List<VMTemplateHostVO> templateHostVOs = _vmTemplateHostDao.listByTemplateHostStatus(templateId, storageHost.getId(), VMTemplateStorageResourceAssoc.Status.DOWNLOADED );
+                if (templateHostVOs != null && !templateHostVOs.isEmpty()) {
+                    VMTemplateHostVO tmpHostVO = templateHostVOs.get(0);
+                    isoPath = storageHost.getStorageUrl() + "/" + tmpHostVO.getInstallPath();
                     return new Pair<String, String>(isoPath, storageHost.getStorageUrl());
                 }
             }