Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 75F7017AF0 for ; Mon, 20 Oct 2014 23:49:58 +0000 (UTC) Received: (qmail 95726 invoked by uid 500); 20 Oct 2014 23:49:58 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 95698 invoked by uid 500); 20 Oct 2014 23:49:58 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 95689 invoked by uid 99); 20 Oct 2014 23:49:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2014 23:49:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0C7D99D3D45; Mon, 20 Oct 2014 23:49:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nitin@apache.org To: commits@cloudstack.apache.org Message-Id: <5ac91e67021340ca85b626e7597407ce@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.5 to 287ff83 Date: Mon, 20 Oct 2014 23:49:58 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/4.5 e796d418b -> 287ff8355 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. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/287ff835 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/287ff835 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/287ff835 Branch: refs/heads/4.5 Commit: 287ff83552081cd91c68af6214016ca4cc4cc040 Parents: e796d41 Author: Nitin Mehta Authored: Mon Oct 20 16:49:48 2014 -0700 Committer: Nitin Mehta Committed: Mon Oct 20 16:49:48 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/287ff835/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 247ed00..c7d2283 100755 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -1413,9 +1413,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());