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 08F4610B8C for ; Thu, 22 Aug 2013 23:03:55 +0000 (UTC) Received: (qmail 41241 invoked by uid 500); 22 Aug 2013 23:03:54 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 41197 invoked by uid 500); 22 Aug 2013 23:03:54 -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 41111 invoked by uid 99); 22 Aug 2013 23:03:54 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Aug 2013 23:03:54 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 46F058C32C1; Thu, 22 Aug 2013 23:03:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: animesh@apache.org To: commits@cloudstack.apache.org Date: Thu, 22 Aug 2013 23:03:57 -0000 Message-Id: <80580732153a47d6b6b08c9ab7410b41@git.apache.org> In-Reply-To: <3da5813254dd407cb1a82921c5616f7c@git.apache.org> References: <3da5813254dd407cb1a82921c5616f7c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/4] git commit: updated refs/heads/4.2 to 6ba0c7e CLOUDSTACK-4455:object_store - Template sync results in private templates being synced to all the secondary stores. (cherry picked from commit 18aacd48a2cac2f66b6ff7c70a73dc39b8d6ece1) Signed-off-by: animesh Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6ba0c7e6 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6ba0c7e6 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6ba0c7e6 Branch: refs/heads/4.2 Commit: 6ba0c7e67bc2ba6195c391a58cbda4c2efce22ea Parents: a49d39f Author: Min Chen Authored: Thu Aug 22 15:37:37 2013 -0700 Committer: animesh Committed: Thu Aug 22 15:53:35 2013 -0700 ---------------------------------------------------------------------- .../apache/cloudstack/storage/image/TemplateServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ba0c7e6/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java index 92470ed..a77270f 100644 --- a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java +++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java @@ -73,6 +73,7 @@ import com.cloud.exception.ResourceAllocationException; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.storage.DataStoreRole; import com.cloud.storage.StoragePool; +import com.cloud.storage.Storage.TemplateType; import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; import com.cloud.storage.VMTemplateVO; import com.cloud.storage.VMTemplateZoneVO; @@ -404,6 +405,11 @@ public class TemplateServiceImpl implements TemplateService { s_logger.info("Skip downloading template " + tmplt.getUniqueName() + " since no url is specified."); continue; } + // if this is private template, skip sync to a new image store + if (!tmplt.isPublicTemplate() && !tmplt.isFeatured() && tmplt.getTemplateType() != TemplateType.SYSTEM) { + s_logger.info("Skip sync downloading private template " + tmplt.getUniqueName() + " to a new image store"); + continue; + } if (availHypers.contains(tmplt.getHypervisorType())) { s_logger.info("Downloading template " + tmplt.getUniqueName() + " to image store "