You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ni...@apache.org on 2014/10/21 01:50:39 UTC
git commit: updated refs/heads/master to a72580d
Repository: cloudstack
Updated Branches:
refs/heads/master 3db112f75 -> a72580def
CLOUDSTACK-7754: Templates source_template_id is null when it is created from Snapshot with its corresponding volume removed. Fix it by searching for volumes including removed.
(cherry picked from commit 287ff83552081cd91c68af6214016ca4cc4cc040)
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a72580de
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a72580de
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a72580de
Branch: refs/heads/master
Commit: a72580def0b555f479fbaa093cf4f8d95a8ea756
Parents: 3db112f
Author: Nitin Mehta <ni...@citrix.com>
Authored: Mon Oct 20 16:49:48 2014 -0700
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Mon Oct 20 16:50:22 2014 -0700
----------------------------------------------------------------------
server/src/com/cloud/template/TemplateManagerImpl.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a72580de/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index a1ca344..615dcb9 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -1410,9 +1410,10 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
privateTemplate = _tmpltDao.findById(templateId);
if (snapshotId != null) {
- //getting the prent volume
+ //getting the parent volume
long parentVolumeId = _snapshotDao.findById(snapshotId).getVolumeId();
- VolumeVO parentVolume = _volumeDao.findById(parentVolumeId);
+ //Volume can be removed
+ VolumeVO parentVolume = _volumeDao.findByIdIncludingRemoved(parentVolumeId);
if (parentVolume != null && parentVolume.getIsoId() != null && parentVolume.getIsoId() != 0) {
privateTemplate.setSourceTemplateId(parentVolume.getIsoId());