incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject git commit: only check ISO which is downloaded status
Date Mon, 10 Sep 2012 20:29:52 GMT
Updated Branches:
  refs/heads/master c14dcd2da -> 044291738


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/04429173
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/04429173
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/04429173

Branch: refs/heads/master
Commit: 0442917381a573d11d70507d452bdeb43787a6bc
Parents: c14dcd2
Author: Anthony Xu <anthony@cloud.com>
Authored: Mon Sep 10 13:30:25 2012 -0700
Committer: Anthony Xu <anthony@cloud.com>
Committed: Mon Sep 10 13:30:25 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/04429173/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());
                 }
             }


Mime
View raw message